Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Engine.get_{process,physics}_step() to get unscaled time delta #86766

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Jan 3, 2024

This can be used for manual UI animations or code whose behavior shouldn't vary depending on Engine.time_scale.

This also clarifies the physics_steps_per_frame documentation with regards to fixed FPS behavior.

Testing project: test_unscaled_delta.zip

Preview

simplescreenrecorder-2024-01-03_23.28.03.mp4

@Calinou Calinou added this to the 4.x milestone Jan 3, 2024
@Calinou Calinou requested review from a team as code owners January 3, 2024 22:36
@Calinou Calinou force-pushed the engine-add-unscaled-process-physics-delta-getters branch from b38304a to bf6790d Compare January 3, 2024 22:37
@lawnjelly
Copy link
Member

This looks great, I'm wondering whether a name like get_physics_step_unscaled() might be more informative?

Otherwise aside from reading the docs, I don't see any reason why the user would expect this value to be any different to the value passed to physics_process().

doc/classes/Node.xml Outdated Show resolved Hide resolved
doc/classes/Node.xml Outdated Show resolved Hide resolved
@Calinou Calinou force-pushed the engine-add-unscaled-process-physics-delta-getters branch from bf6790d to 9c88c32 Compare January 10, 2024 23:24
This can be used for manual UI animations or code whose behavior
shouldn't vary depending on `Engine.time_scale`.
@Calinou Calinou force-pushed the engine-add-unscaled-process-physics-delta-getters branch from 9c88c32 to f2df31c Compare February 27, 2024 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants