Once the Transform Rotator Script is attached to a GameObject it will start Rotating on Update in every Frame.
TransformRotator.cs
using UnityEngine;
///
/// We use Time.deltaTime so the Rotator can be fine adjusted
/// Ranges from 5 - 50 work well
///
public class TransformRotator : MonoBehaviour
{
[SerializeField] float xAngle = 0;
[SerializeField] float yAngle = 0;
[SerializeField] float zAngle = 0;
void Update()
{
transform.Rotate(xAngle * Time.deltaTime, yAngle * Time.deltaTime, zAngle * Time.deltaTime);
}
}
To make the TransformRotator more adjustable we make use of Time.deltaTime so we can use Angle Numbers in higher Values. Best Ranges are usually around 5 – 50, depending on your Project it can be more or less.