1
Fork 0
mirror of https://github.com/Steffo99/cinnos.git synced 2024-11-25 17:44:21 +00:00
This commit is contained in:
Steffo 2023-11-25 13:51:24 +01:00
parent d80caa306f
commit d465676cc4
2 changed files with 5 additions and 3 deletions

View file

@ -33,13 +33,13 @@ func _physics_process(delta):
do_jump() do_jump()
# Applica gravità # Applica gravità
velocity += gravity_accel velocity += gravity_accel * delta
# Applica input # Applica input
var input_dir = Input.get_vector("move_left", "move_right", "move_up", "move_down") var input_dir = Input.get_vector("move_left", "move_right", "move_up", "move_down")
var input_change = input_dir * input_accel var input_change = input_dir * input_accel
velocity.x += input_change.x velocity.x += input_change.x * delta
velocity.z += input_change.y velocity.z += input_change.y * delta
print(velocity) print(velocity)

View file

@ -59,3 +59,5 @@ shape = SubResource("BoxShape3D_2bm1d")
[node name="Camera3D" type="Camera3D" parent="."] [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) 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="."]