Reduce CPU load and improve physics performance by enabling RigidbodyA component that allows a GameObject to be affected by simulated gravity and other forces. More info
See in Glossary sleeping for stationary objects.
Rigidbody sleeping can drastically reduce CPU load, especially in scenesA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary with many physical objects that are often stationary or frequently come to rest. When a Rigidbody component moves at a slower speed than the Sleep Threshold, the physics system sets the Rigidbody component to a sleeping state. When a Rigidbody component is asleep, the physics system doesn’t include it in physics calculations. When a sleeping Rigidbody component receives a collisionA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More info
See in Glossary or force, the physics system wakes up the Rigidbody component and includes it in physics calculations.
In script, control Rigidbody sleeping with Rigidbody.Sleep
and Rigidbody.WakeUp
Rigidbody sleeping is highly effective in environments with many interactive props, destructible elements that settle, or physics-based puzzles that stabilize. While scenes with constant high-velocity motion benefit less, enabling sleeping is generally a good default behavior.
To enable Rigidbody sleeping, the recommended best practices are:
Rigidbody.sleepThreshold
.Rigidbody.WakeUp
unnecessarily on objects unless they need to be active in the simulation. Continuously waking objects negates the benefit of sleeping.Rigidbody.IsSleeping
.