|
Hey guys, I currently have my gun setup in my FPS game so that the player can shoot, a muzzle flash occurs, and there is a blood particle system instantiated when the player shoots at the enemy. all I can't figure out now is how to take down the health variable of the enemy one by one each time the enemy is shot!!!!! Here is my gun script!: } That all works good!, but how would i take down the health of the enemy tagged "zombie" when it hits it. The zombie has a script on it called "zombie" and a health variable called "health" if that matters! Thanks! -Grady
(comments are locked)
|
|
I suppose the easiest way would be to use Hey, Thanks for your response, I noticed I could do it with GetComponent pretty much the same way you showed here, but by going: hit.collider.GetComponent(zombie).health --; -Grady
Dec 23 '11 at 12:21 PM
Grady
Oh, of course, if the field is public. I presumed it was private for some reason. :P
Dec 23 '11 at 01:04 PM
asafsitner
Oh well, thank you for your help!!!!!!!!!!
Dec 23 '11 at 01:42 PM
Grady
(comments are locked)
|
