Final touches
This commit is contained in:
12
Player.gd
12
Player.gd
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user