How to make a calculation frame rate independent?

Happy holidays everyone!
Does anyone know how I can make this algorithm frame rate independent? I’m creating a ball swerve mechanic for my soccer game. Adding the swerve force is fine but decaying the amount of swerve over time has different results at different frame rates.

Needed to multiply decay amount by delta time then subtract this from the ball curl value.

You can make a calculation frame rate independent by using delta time (dt). To ensure consistency, multiply the value being calculated by the time between frames (delta time). To maintain smooth movement at varying frame rates, game developers multiply movement speed by deltaTime. It makes sure your logic runs consistently at different frame rates.

Thanks. I managed to figure it out in the end :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.