using UnityEngine; public sealed class LocalTurnProbe : MonoBehaviour { [SerializeField] private Vector3 targetLocalEuler = new Vector3(0f, 90f, 0f); [SerializeField, Min(0f)] private float degreesPerSecond = 45f; private Quaternion goal; private void Start() { goal = Quaternion.Euler(targetLocalEuler); } private void Update() { if (degreesPerSecond < 0f || float.IsNaN(degreesPerSecond) || float.IsInfinity(degreesPerSecond)) return; transform.localRotation = Quaternion.RotateTowards(transform.localRotation, goal, degreesPerSecond * Time.deltaTime); Debug.DrawRay(transform.position, transform.forward * 2f, Color.blue); } }