Setting Physics Ticks according to ScreenRefreshRate (At the Right Time)

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nickyroo

The Goal:

Engine.set_physics_ticks_per_second(DisplayServer.screen_get_refresh_rate())

But it would not be as performant to have this in process

How would you emit that signal for only when a Display Setting is changed on the Users Computer?

Why do you want to do this? The point of the physics ticking is that it’s at a constant pace, regardless of rendering. Otherwise your physics would work inconsistently.

zhyrin | 2023-06-14 05:32

It regards only of movement, nothing to do with Objects or Built-In Gravity

Nickyroo | 2023-06-14 14:34

:bust_in_silhouette: Reply From: svdragster

I think what you’d rather want is physics interpolation: https://docs.godotengine.org/de/stable/tutorials/physics/interpolation/using_physics_interpolation.html

Physics should be calculated at a fixed rate to stay consistent. In order to get smooth movements at higher display refresh rates, interpolation can be a solution.

An add-on was already created for this purpose: GitHub - anatolbogun/godot-smoother-node: A Godot node type that smoothes scene nodes' movements by interpolating between _physics_process steps.

Thanks but this does not help, I seek to simply Change Settings according to the signal of a User’s Device settings being Changed

Nickyroo | 2023-06-14 14:36