I’m trying to figure out how to turn off player collision with a dead player.
I have access to flags from scripting to see if the player is dead or alive, but I’m not sure how in Unity to simply turn on/off player collision based off of a flag? This would allow other players to run “through” the dead player lying on the ground.
Just Destroy collider or make it isTrigger = true.
Destroy(gameObject.GetComponent<BoxCollider>()); //or whatever else collider you are using
// or
gameObject.GetComponent<BoxCollider>().isTrigger = true; // physics to the world will not be translated
2 Likes