Skip to content

Do physics in fixed update, do visuals in update - #58

Merged
qhdwight merged 5 commits into
mainfrom
fix-time-handling
Jan 2, 2026
Merged

Do physics in fixed update, do visuals in update#58
qhdwight merged 5 commits into
mainfrom
fix-time-handling

Conversation

@qhdwight

@qhdwight qhdwight commented Jan 2, 2026

Copy link
Copy Markdown
Owner

This was a pretty glaringly big issue which is kind of embarrassing.

Before we were doing physics in Update which is not good since it is essentially the render loop and does not run in a fixed time step.

Now we do physics in FixedUpdate which is where Rapier/Avian update internally. And then for visuals we interpolate.

There is a great explanation here that is less terse than the above: https://github.com/bevyengine/bevy/blob/main/examples/movement/physics_in_fixed_timestep.rs

Closes #54

@qhdwight
qhdwight marked this pull request as ready for review January 2, 2026 06:11
@qhdwight qhdwight added bug Something isn't working enhancement New feature or request labels Jan 2, 2026
@qhdwight
qhdwight merged commit 572b8eb into main Jan 2, 2026
1 check passed
@qhdwight
qhdwight deleted the fix-time-handling branch January 3, 2026 04:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor update logic

1 participant