Animate boss while he's rotating.

Hi!

I’m working on a boss battle and I’m having the boss look at the player at all times.
It’s a classic move-around-in-a-circle boss battle with the boss in the middle.
I also want the boss to play off the rotation animation while rotating.

Is there a way to check if an object is rotating and maybe use that for a while loop?

just add a boolean

//just use a boolean
var isRotating : boolean;

//
//whenever you rotate the object just set it to true

          if(objectshouldrotate){//obviously not a real if statement you should already have one sort of like this
                    
                    tranform.Rotate(1,0,0);
                    isRotating == true;

          }

//

//and then somewhere else just put

if(isRotating == true){
          //play animation here
}
//or
while(isRotating == true){
          //play animation here
}


//moreover you could just do it all in one!

//ex

          if(objectshouldrotate){//obviously not a real if statement you should already have one sort of like this
                    
                    tranform.Rotate(1,0,0);
                   //play animation

          }