Quantcast
Channel: Answers by "jjkiii"
Viewing all articles
Browse latest Browse all 10

Answer by jjkiii

$
0
0
Mattsson almost completed the question. In C# i would... OnTriggerEnter(Collider other) { //assuming your bullet is tagged as bullet and the enemy has no health. if(other.gameObject.tag == "bullet") { Destroy(GetComponent()); } } Put this on the same object that the EnemyAI script is! You can use GetComponent() for many things as shown here: http://docs.unity3d.com/ScriptReference/GameObject.GetComponent.html Hope This Helps! =D

Viewing all articles
Browse latest Browse all 10

Trending Articles



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