From 8a8e19cf128cb816e2cd3d38d8ee80e07cb07f03 Mon Sep 17 00:00:00 2001 From: GamerClassN7 Date: Sat, 29 Jan 2022 00:26:31 +0100 Subject: [PATCH] Fixed Rotation --- Assets/Scripts/PlayerController.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/PlayerController.cs b/Assets/Scripts/PlayerController.cs index 8cf80e5..8c2ecdc 100644 --- a/Assets/Scripts/PlayerController.cs +++ b/Assets/Scripts/PlayerController.cs @@ -58,7 +58,8 @@ public class PlayerController : MonoBehaviour if (this.collisionGameObject != null) { - transform.rotation = Quaternion.Slerp(transform.rotation, this.collisionGameObject.transform.rotation, Time.deltaTime * 1.0f); + Quaternion tempRotate = new Quaternion(transform.rotation.x, transform.rotation.y, this.collisionGameObject.transform.rotation.z, transform.rotation.w); + transform.rotation = Quaternion.Slerp(transform.rotation, tempRotate, Time.deltaTime * 1.0f); } rb.MovePosition(rb.position + moveDirection);