Control physics_frame manually

Godot Version

4.2.2

Question

Is there any way to control physics_frame manually?
Such as a method like PhysicsServer3D.step(duration)or something like.
My purpose is control PhysicsServer running, not control my code running.

You can access ProjectSettings directly within code and change its parameters.

e.g.

ProjectSettings.get_setting("physics/common/physics_ticks_per_second")
ProjectSettings.set_setting("physics/common/physics_ticks_per_second", 60)

I means run a physics frame manually, and disable default physics frame loop.
I will use it on multiplayer synchronizing with frame sync to make process and physics are synchronized.

Not exposed in the godot physics API. See Add `PhysicsServer2/3D::space_step()` to step physics simulation manually by Daylily-Zeleen · Pull Request #76462 · godotengine/godot · GitHub .

1 Like

I don’t think you need a custom physics loop to “make process and physics synchronized” but for client side prediction of rigid bodies you would definitely need a way to step the physics engine.

1 Like