Is there a way to manually control simulations in the Physics engine?

Hi.

When I call the enablePhysics method, physics simulation automatically plays. Is it possible to stop it and manually advance the simulation by just one step (tick)?
It would be helpful if I could pass the delta value (ms) from the previous frame when updating.

The purpose is that I’m developing a physics-based game and want to be able to pause the simulation. Also, to enhance the game’s replayability, I want precise control over frames, such as advancing the simulation by a specific number of steps.

Note: I do not want to stop rendering itself. I only want to manually control the physics simulation independently.

Calling scene.render with ignoreAnimations=true and separately calling scene.animate at any desired timing seems to achieve the goal.
However, there doesn’t appear to be a way to pass an arbitrary delta.

When creating the physics engine, set false to the 1st parameter (use delta) then you can use Babylon.js docs

1 Like