Final touches

This commit is contained in:
2024-06-12 17:51:29 +02:00
parent 9cfd9e0200
commit 965a56c7ad
8 changed files with 120 additions and 77 deletions

View File

@@ -14,14 +14,10 @@ func _physics_process(delta):
var direction = Vector3.ZERO
# Check inputs
if Input.is_action_pressed("move_right"):
direction.x += 1
if Input.is_action_pressed("move_left"):
direction.x -= 1
if Input.is_action_pressed("move_back"):
direction.z += 1
if Input.is_action_pressed("move_forward"):
direction.z -= 1
direction.x = Input.get_axis("move_left", "move_right")
direction.z = Input.get_axis("move_forward", "move_back")
$Control/Direction.text = "x: %.2f, z: %.2f" % [direction.x, direction.z]
# If in movement, normalize direction and change looking_at
if direction != Vector3.ZERO: