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);
}
}
}
↧