Freeze Ship Using Sleep() on Rigid Body

I found it helpful to write

rigidBody.Sleep();

inside the switch statement for the cases of Dying and Transcending. It has the effect of turning off the rigid body so that the ship freezes in place. Using this also means you don’t need to exit the OnCollisionEnter method if not alive as the ship will no longer be bumping into anything or even checking for collisions while the rigid body is asleep.

1 Like

Privacy & Terms