Quantcast
Channel: Questions in topic: "enemy"
Viewing all articles
Browse latest Browse all 1488

Instantiate Explosion Position

$
0
0
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); } } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>