Quick answer: Set can_sleep = false on critical bodies, or raise the project’s 3D sleep threshold so slow-moving objects don’t freeze prematurely.
A physics puzzle drops blocks onto a switch. Sometimes the last block stops just shy of the trigger — visual confirms it’s still in motion, but the engine reports it sleeping. Switch never activates.
Why Sleep Exists
Stacks of resting bodies cost CPU each tick. Sleep retires them from the active list until something pokes them awake (collision, applied force, kinematic neighbour). Default thresholds suit static piles; physics puzzles with low-speed motion can trigger sleep prematurely.
Per-Body Override
@onready var block: RigidBody3D = $Block
func _ready():
block.can_sleep = false
Disables sleeping for that body forever. Use for the few bodies whose precise resting position matters.
Project-Wide Tuning
Project Settings → Physics → 3D:
- Sleep Threshold Linear: default 0.1. Lower to 0.02 to delay sleep further.
- Sleep Threshold Angular: same idea for spin.
- Time Before Sleep: default 0.5s. Raise to 2s to give physics longer to settle visibly.
Manual Wake
func _physics_process(delta):
if block.sleeping and block.global_position.distance_to(target) > 0.01:
block.sleeping = false
Force-wake when game logic demands continued simulation.
Verifying
Drop blocks repeatedly. With override, last block always touches switch reliably. CPU profile: physics tick time within budget.
“Sleeping is a default that fits 95% of bodies. For the last 5%, opt out per-object.”
Heavy stack scenes (Jenga, terrain rubble) keep sleeping on by default — only tweak the few that drive gameplay decisions.