Instantiate Explosion Position

I have a problem with Explosions of the enemy… When the enemy is destroyed, I want to instantiate particles as a prefab, and everything works fine, but it explodes far away from the enemy :\ That`s the problem… Can you help me please? I sure there is some mistake right there in instantiate position…

public GameObject enemyexplosion;

// Use this for initialization
void Start () {

}

// Update is called once per frame
void Update () {

}

void OnCollisionEnter(Collision c){
	if (c.gameObject.tag == "Player") {
		Destroy(c.gameObject);
		Instantiate(enemyexplosion, transform.position, transform.rotation);
		Destroy(gameObject);

	}
  }
}

Thank you guys, but i found the problem. I attached the script to bullet that killing it and not to the enemy and it works. :slight_smile:

Hello Ilana.
If this script is not attached to the actual enemy, you will want to get the enemy’s position and use that during instantiate.

Also, you might want to check the prefab’s position in the project window, and if it is not all zeroed out, zero it out.