Quantcast
Channel: Latest Questions on Unity Answers
Viewing all articles
Browse latest Browse all 171066

Hello, I would like to know how to end my game when my player has been destroyed heres my code:

$
0
0
var player : GameObject; function OnCollisionEnter(collision : Collision) { if(collision.gameObject.tag=="Enemy"){ Destroy(player); print("hit"); } }

Viewing all articles
Browse latest Browse all 171066

Trending Articles