i want to know if their is a better way to check if a specific animation is playing, or even just to see the name of the one currently playing aside from something like this as i suspect this is a needless waste of processing power.
for (var state : AnimationState in animation) {
switch(state.name){
case animation A:
break;
case animation B:
break;
}
}
I’ve been using the following to determine if I have an animation playing. Is this what you’re after?
if (animation["walk"].enabled == true) {
// the animation named "walk" is playing
}
yes thank you this is exactly what i was looking for
i’ve come across another optimization issue, is it possible to check which animation is playing without alot of if statements?
i have 38 animations currently on our character, so i’m hoping their is an easier way to optimize the code so i don’t have to do 38 if checks each frame.
if(animation.IsPlaying("walk"))
{
print("I'm walking");
}