I’m trying to get the collision to cause the game to be over. I didn’t put it at the scripting section because it works fine with other objects besides the “obstacle”. I ticked the obstacle as ‘is trigger’ and also the ‘head’. However, it still doesn’t works. I might post a picture if this is too vague.
Thanks for helping!
void OnTriggerEnter(Collider coll) {
// Food?
if (coll.name.StartsWith ("Coin")) {
// Get longer in next Move call
ate = true;
// Remove the Food
Destroy (coll.gameObject);
}
// Collided with Tail or Border
if (coll.name.StartsWith ("Obstacle")) {
Destroy (head);
// ToDo 'You lose' screen
}
}