physics acting different on different pc's

Godot Version

4.3

Question

godot is the first engine that worked perfectly so far on linux for me, so I reall hope someone has an answer. I'm just using the default code that came in the script, and it worked well, but when I used the same code with the same values on a school windows computer, all of a sudden the forces are way lower. I don't know why this is happening, all the movement code is inside the "_physics_process" function, and I don't see any reason for this, please help this is unusable :(

Sounds like you may be writing frame-dependent code. The delta parameter is very important to writing scripts that behave the same over time rather than per-frame. This isn’t necessarily physics, but it’s worth mentioning that the physics engine (RigidBodys, joints etc) isn’t deterministic, so it will behave the similarly but not exactly the same each time the game runs.

You may have to share your script for any specific help.

3 Likes

To add onto what @gertkeno said, whenever your scripts use lerp() or move_toward(), make sure you multiply your 3rd parameter by delta. Then you will probably have to increase all of those values, so they have the same effect.

Edit: Don’t use it for lerp

Also, go to the project settings and change the physics_ticks_per_second to match your original pc’s. If you copied the code and not the project, there is a chance those are different.

Actually for lerp using delta in the third parameter makes it even more frame-dependent. It’s third parameter isn’t a linear value, but a percentage that changes after every call. One should avoid naive lerp smoothing for gameplay important functions like movement/speed.

1 Like