From 0938a485633d10851eb9532f7e3dfdfd16ba1344 Mon Sep 17 00:00:00 2001 From: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Date: Thu, 7 Sep 2023 18:28:18 +0200 Subject: [PATCH] [Squash The Creeps] Use `Basis.looking_at` to control facing Co-authored-by: Aaron Franke --- 3d/squash_the_creeps/Player.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/3d/squash_the_creeps/Player.gd b/3d/squash_the_creeps/Player.gd index 9854c9cdb3..f557c73fc9 100644 --- a/3d/squash_the_creeps/Player.gd +++ b/3d/squash_the_creeps/Player.gd @@ -26,7 +26,8 @@ func _physics_process(delta): 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(position + direction, Vector3.UP) + # Setting the basis property will affect the rotation of the node. + $Pivot.basis = Basis.looking_at(direction) $AnimationPlayer.speed_scale = 4 else: $AnimationPlayer.speed_scale = 1