Please use code tags: Using code tags properly
You dont need
else if (!rotOn)
{
transform.Rotate(0f, 0f, 0f);
}
because it wont do anything
if you want to change the speed change rotSpeed
like rotSpeed = 5f; or rotSpeed = 10f;
if you want to change the speed slowly use IEnumerator (kinda advanced but if you want to search it up) or use some kind of cooldown to change the speed (in another script)
(maybe do it public so you can change it from other classes)
Also dont use this
if(rotOn)
{
rotOn = false;
}
else if(!rotOn)
{
rotOn = true;
}
use
rotOn = !rotOn