Skip to content

Conversation

Jakkestt
Copy link

This commit fixes the issue where if the games refresh rate is longer than the fixed timestep configured in the engine, when there is more than 1 fixed update within an update, the interpolation struct would hold the same position twice, making interpolation useless. The way you fix this issue is that you put the systems that are in charge of updating the interpolation struct in the FixedUpdate schedule and you constantly keep the struct updated on the 2 latest positions. You then have to put the system that is in charge of interpolation in the PostUpdate schedule, because we want interpolated position within the current fixed update and the next fixed update.

@Vrixyz
Copy link
Contributor

Vrixyz commented Feb 28, 2025

Thanks! Do you have opinions about relying on other crates for interpolation ? Such as https://github.com/Jondolf/bevy_transform_interpolation.

@Jakkestt
Copy link
Author

I tried to do the interpolation on my own, and although the interpolation itself did work, the physics did not work correctly. Going up ramps felt like I was moving in to the ramp at times and going down ramps didn't actually snap me down the ramp and instead just moved me into the air. That makes me think that doing the interpolation in rapier is a much better idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants