Different ball speed on different computers

Hello. I’ve created a simple roll the ball game. When I play the game on my computer (built game) the ball roll faster than for example on my friend’s PC or in the Unity editor. How can I fix it? I use Unity 2020.3.18f1 Personal and C# for the game scripts. The game code: GitHub - Maxisy/RacingBallGame: Gra Racing Ball tworzona na kursie Unity.. Thanks.

Hi

In Sphere.cs, you need to multiple by deltaTime to account for fps differences between your machines.

rigidbody.AddForce(direction  * Time.deltaTime);

Note, this is the Cinemachine forum.
For input related questions, ask on Unity Engine - Unity Discussions, and see their docs: Quick start guide | Input System | 1.0.2.

Hello, thanks for the response. I edited the code and somehow the ball isnt’t moving now.

Never mind, the Time.deltaTime is just very small value, like 0.001 so I multiplied it by 500 and everything is fine now, thanks :slight_smile:

1 Like