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

EnemyHealth.js script not working...

$
0
0
I have been working on this script for the past month and my collisions are not working... I have a drone and when a bullet hits the Sphere Collider, I want the drone to lose health and after it has been hit three times, I want the drone to add a rigidbody component and after 3 seconds, to disappear... Any suggestions? Here's my code so far... #pragma strict function OnCollisionEnter(deadPlayer : Collision) { if (deadPlayer.gameObject.tag == "Drone") { Debug.Log("HIT"); Destroy(GameObject.FindGameObjectWithTag("Drone")); } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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