I want to destroy my Player when his Body or head touch the ground.
And when he stand on his feet it should not destroy.
Please Help me.
1.Add two separate colliders Player and adjust it it to fit with Body and Head.
2.Add collider to ground
3.Change Tag of the Ground and Player
4.Attach below code to Ground
private void OnCollisionEnter(Collision other)
{
if(other.tag == "Player")
{
Destroy(other.gameObject);
}
}
Put colliders on the head and torso and then test for them.
Just put different colliders on the feet and legs, and have the torso and head colliders kill on touching the ground.