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="."]