From af4678076e5efefbb4abeccfc4c76a23ef1de3ac Mon Sep 17 00:00:00 2001 From: Nathan Lovato Date: Fri, 27 Nov 2020 19:28:31 -0600 Subject: [PATCH] Update direction comparison --- dodge_the_creeps_3d/Player.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dodge_the_creeps_3d/Player.gd b/dodge_the_creeps_3d/Player.gd index d6e2e28..24fcf6a 100644 --- a/dodge_the_creeps_3d/Player.gd +++ b/dodge_the_creeps_3d/Player.gd @@ -25,7 +25,7 @@ func _physics_process(delta): if Input.is_action_pressed("move_forward"): direction.z -= 1 - if direction.length() > 0: + if direction != Vector3.ZERO: # In the lines below, we turn the character when moving and make the animation play faster. direction = direction.normalized() $Pivot.look_at(translation + direction, Vector3.UP)