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

How to I make individual hit boxes for my zombies?

$
0
0
#pragma strict var health : int; var Zombie : GameObject; function Start () { Zombie = GameObject.FindWithTag("Zombie"); health = 100; } function OnTriggerEnter(other : Collider) { if(other.tag == "shot") { health = health - 34; } } function Update () { if(health <= 0) { print("Enemy Down!!"); health = 0; Destroy(Zombie); } }

Viewing all articles
Browse latest Browse all 1488

Trending Articles



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