Skip to content

Commit 1113baf

Browse files
authored
Merge pull request #945 from AThousandShips/fix_global
[Squash The Creeps] Use `Basis.looking_at` to control facing
2 parents 68aefef + 0938a48 commit 1113baf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

3d/squash_the_creeps/Player.gd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ func _physics_process(delta):
2626
if direction != Vector3.ZERO:
2727
# In the lines below, we turn the character when moving and make the animation play faster.
2828
direction = direction.normalized()
29-
$Pivot.look_at(position + direction, Vector3.UP)
29+
# Setting the basis property will affect the rotation of the node.
30+
$Pivot.basis = Basis.looking_at(direction)
3031
$AnimationPlayer.speed_scale = 4
3132
else:
3233
$AnimationPlayer.speed_scale = 1

0 commit comments

Comments
 (0)