Hi. I’m trying to make the player die when it collides with objects with a certain tag. However it’s not working and i’m not sure whether it has something to do with the fact i’m using character coliders or not.
Here’s my code:
var Corpse : GameObject ;
var Lobby_Camera : Transform ;
function OnCollisionEnter(collision : Collision)
{
if ( collision.gameObject.tag == "Water" )
{
Instantiate(Corpse, transform.position, transform.rotation);
Destroy (gameObject) ;
Lobby_Camera.active = true;
}
}
This should be working as i have used it in previous projects, so honestly i’m at a loss with this