From d465676cc4fc9f65e26c8a30e147449e1a73e7be Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 25 Nov 2023 13:51:24 +0100 Subject: [PATCH] Delta --- Player.gd | 6 +++--- Root.tscn | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Player.gd b/Player.gd index 9a90895..b21c839 100644 --- a/Player.gd +++ b/Player.gd @@ -33,13 +33,13 @@ func _physics_process(delta): do_jump() # Applica gravità - velocity += gravity_accel + velocity += gravity_accel * delta # Applica input var input_dir = Input.get_vector("move_left", "move_right", "move_up", "move_down") var input_change = input_dir * input_accel - velocity.x += input_change.x - velocity.z += input_change.y + velocity.x += input_change.x * delta + velocity.z += input_change.y * delta print(velocity) diff --git a/Root.tscn b/Root.tscn index 32f72dc..e176a83 100644 --- a/Root.tscn +++ b/Root.tscn @@ -59,3 +59,5 @@ shape = SubResource("BoxShape3D_2bm1d") [node name="Camera3D" type="Camera3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.955149, 0.296125, 0, -0.296125, 0.955149, 0, 2.66196, 3.33182) + +[node name="Timer" type="Node" parent="."]