I’m trying to get my game objects to move at the same speed no matter what framerate I’m running the game at, but I can’t seem to get it working. This is the code I am using.
I multiply the speed I apply to the player by World Delta Seconds, but objects still move slower at lower framerates.
For context: the Acceleration variable is completely independent of the framerate, it is only dependent on the player’s position in world space.
Am I using World Delta Seconds in the wrong way or moment?
Hey,
I believe you want to move the Delta Multiplication to the point where you add the Accel to the speed. At this point the Acceleration should be multiplied by DeltaTime, which should reduce the amount that speed is increased/decreased each frame based on that value.
1 Like
I tried these two solutions just now:
neither solves the issue. Do you have any other ideas what it could be?
Edit: I did some more testing and the top solution does seem to work. Would it make sense to you that I multiply by World Delta Seconds twice?
Yeah I think the reason your needing to do that twice there is because of how your changing the location.
So yeah you want to make sure your only adjusting the Acceleration based on the frame rate but you also want to ensure your moving based on your speed value according to the Frame Rate as well.
1 Like