-
-
Notifications
You must be signed in to change notification settings - Fork 23.4k
Description
Godot version: 3.3
Platforms: MacOS, Android
Issue description:
Hello there. I'm making a racing game. Player car and other cars are Rigidbody2D type objects. Gameplay is very smooth at 60 FPS. But sometimes even a little drop in FPS(50-55) causes rigidbodies to jitter. How do I fix that (except keep fps at 60. Because it will be a mobile game and maybe not everyone able to play it on 60 FPS). I tried both versiyon 3.2.3 and 3.3
Physics jitter fix: 0.5
Code looks something like this (I can send more detailed if needed):
func _physics_process(delta):
if speed>speed_limit:
thrust = Vector2(0, 0)
else:
thrust = Vector2(engine_power, 0)
set_applied_force(thrust.rotated(rotation))
Steps to reproduce:
Set your project FPS limit to 50. Set physics FPS to 60. Apply force to a Rigidbody2D. You will see object jitters.
Bugsquad edit: For reference, this was cross-posted on Godot forums: https://godotforums.org/discussion/26109/rigidbody2d-jitters-on-fps-drops