- Home /
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?
What's causing the boss to rotate? If you have some code that's rotating the transform, that same code can call the animation (or set a flag).
Answer by rednax20 · May 19, 2014 at 08:49 PM
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
}
Your answer
Follow this Question
Related Questions
How to check rotations 1 Answer
Lerping smoothly between animation and new position 2 Answers
How do I make something rotate until a condition is met 1 Answer
Rotation Y axis is bugged. 2 Answers
Make the player go into the direction I am looking at 0 Answers