replay.tool
This package holds more than this page lists. See all of its files in its world.
README.md
phys.replay
Record a stretch of the physics simulation and play it back: an instant replay, a crash in slow motion, a kill cam, scrubbing back and forth through what just happened, watched from any camera.
record starts recording every physics step, keeping the most recent seconds (30 by default): each rigid body's and ragdoll bone's pose and velocities, each soft body's particles, and the moments colliders begin and stop touching. stop stops recording and keeps what it holds. play draws the recording at rate recorded seconds per second (1 by default; 0.25 is quarter-speed slow motion, a negative rate plays backwards, 0 holds a moment), from time when given (a recorded second, between from and to of info), wrapping around with loop. end ends the replay and draws the live simulation again. info reports what is recorded: its span, steps, bodies, soft bodies and particles, its bytes and bytes per recorded second, and what recording cost a step.
Playing draws the recording and nothing more: the live simulation keeps its state, so hold it with engine.paused = true while watching and it is exactly where it was when the replay ends. Wraps Physics.recordReplay, Physics.playReplay and Physics.replayInfo; the physics guide's "Replays" section covers reading recorded frames and contacts, saving a recording and going on from a recorded moment.