-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
KinematicCharacterController speed scales with the refresh rate. #379
Comments
Note: Tried both KinematicPositionBased and KinematicVelocityBased. Issue persists. |
Was able to fix by putting the control system in the PhysicsSet::StepSimulation base set and using the Interpolated timestep mode in the configuration. Is this one of the intended ways of getting this to work? |
This seems to make complete sense with your code. The Rapier's physics scale with the timesteps taken between each frame by default. For example the gravity is multiplied with the timestep before being applied to rigid bodies, giving velocity of -9.81/60 each frame when running at 60FPS and -9.81/120 when running at 120FPS. That's why the movement of rigid bodies stay consistent between different framerates. Using interpolated timestep mode makes the simulation run at a fixed rate, once per timestep, irrespective of the framerate of the renderer or the logic. That's where putting the system into To get this to work, make your system take a |
Thanks Architector for your answer, seems correct. Closing now. |
When I set my monitor to 144hz, my player character moves faster than at 60hz.
This is not true for dynamic bodies, who move at the same speed regardless of the refresh rate.
Setup
bevy = 0.10
bevy_rapier3d = 0.23
Code
The text was updated successfully, but these errors were encountered: