Game dev
Saved & recent

Sleeping

Related terms: sleep, wake, resting bodies

An optimization. A rigid body that has stayed still for a moment is put to sleep and skipped by the physics engine. It wakes when something touches it or a force is applied.

A level with a thousand resting crates costs almost nothing until the player barges into them. A classic bug: code removes the floor under a sleeping object and it stays hanging in the air.

Further reading
Godot: RigidBody3D
resting stack asleep at rest contact wakes body awake after contact
The crate stack can sleep while at rest. Contact with a rolling marble wakes the highlighted crate so the solver can respond.

View in the full Game dev collection