I have an object with several animations attached to it in the animator. I’m setting up the flow, and things are going good, but I need set a variable based on what animation is playing, or a way to tell what one I’m in.
thought this was the way to go… but maybe not?:
(In my class)
private Animator anim;
private AnimationInfo animInfo;
anim = GetComponent();
Then I thought I could do this:
animInfo = anim.GetCurrentAnimationClipState(0);
if(animInfo.clip == “spin”)
But I get an error on the GetCurrentAnimationClipState because it’s an AnimationInfo and not just AnimationInfo
Maybe I’m doing it all wrong? Anyone have a suggestion for a few lines that will get me the clip name that’s running that I can check against?
thanks in advance!
-B