This commit is contained in:
2026-06-18 15:06:03 +02:00
3 changed files with 268 additions and 2 deletions
-2
View File
@@ -20,7 +20,6 @@ public class Door_Rotate : MonoBehaviour
currentRotation = transform.localEulerAngles.y;
targetRotation = currentRotation;
// Calculate pivot point from rotation offset
pivotPoint = transform.position + rotationOffset;
}
@@ -44,7 +43,6 @@ public class Door_Rotate : MonoBehaviour
{
currentRotation = Mathf.Lerp(currentRotation, targetRotation, Time.deltaTime * rotationSpeed);
// Rotate around the pivot point
transform.RotateAround(pivotPoint, Vector3.up, (currentRotation - transform.localEulerAngles.y));
transform.localEulerAngles = new Vector3(
transform.localEulerAngles.x,