Quick answer: Use the Physics behavior’s Stop simulation action instead of setting time scale to 0. Stops Box2D’s solver entirely; no drift can occur.
A physics puzzle uses revolute joints. Pausing via Time Scale = 0, resuming, then waiting a moment — the jointed bodies have slightly separated from their anchors. Each pause cycle adds drift. Eventually visible misalignment.
Why Time Scale Zero Drifts
Setting time scale to 0 makes dt = 0 for the Box2D step. The solver still runs each tick, just with no time elapsed. Some solver passes still apply position correction (Baumgarte stabilization, for example) even at dt=0, accumulating tiny corrections per tick that show as drift.
The Fix
// On pause
System Set global variable IsPaused to true
System Set time scale to 0
PhysicsWorld Stop simulation // the key step
// On resume
PhysicsWorld Resume simulation
System Set time scale to 1
System Set IsPaused false
Stop simulation halts all Box2D internal step calls. The solver doesn’t run; corrections aren’t applied; no drift. Resume restarts cleanly.
Rebuild Joints if Drifted Already
If your project already has accumulated drift, rebuild joints on resume:
On resume:
Sprite(joint A) Physics Destroy joint "swing"
Sprite(joint A) Physics Create revolute joint "swing" to SpriteB at currentX, currentY
The new joint anchors at current positions; the visual state is preserved while the solver gets a fresh start.
Physics Time Step vs Game Time
Physics behavior has its own internal time step (Project Settings → Physics → Step Size). For deterministic physics, set Stepping Mode = Fixed and pick a step appropriate for your game (1/60s is common). Variable stepping can also contribute to drift.
Verifying
Pause and resume 50 times in a stress test. Anchor positions should stay identical to before pausing. Print global positions of jointed bodies before and after each pause; diff should be zero.
“Time scale 0 isn’t a real pause for Box2D — the solver still nudges. Stop simulation is the clean pause.”
For any game using physics joints, build a centralized pause routine that Stops physics and Resumes — never scatter time scale tweaks.