using UnityEngine; public class AxisRotate : MonoBehaviour { [Header("Rotation Speed (degrees per second)")] public float xSpeed = 0f; public float ySpeed = 0f; public float zSpeed = 0f; [Header("Space")] public Space rotationSpace = Space.Self; private Quaternion initialRotation; void OnEnable() { // Save original rotation when object becomes enabled initialRotation = transform.rotation; } void OnDisable() { // Reset rotation when object becomes disabled transform.rotation = initialRotation; } void Update() { Vector3 rotation = new Vector3(xSpeed, ySpeed, zSpeed); transform.Rotate(rotation * Time.deltaTime, rotationSpace); } }