Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var beenhit = 0;
- function OnControllerColliderHit (hit : ControllerColliderHit) {
- if (hit.gameObject.tag == "bullet") {
- beenhit++;
- Debug.Log("Been HIT!");
- }
- }
- function Update() {
- Debug.Log("beenhit: " + beenhit);
- if (beenhit > 5) {
- Debug.Log("hit more than 5 times!");
- Destroy(gameObject);
- }
- }
Add Comment
Please, Sign In to add comment