- Home /
Question by
LeftyTwoGuns · Mar 01, 2015 at 02:35 AM ·
animation2dspritemecanimstate-machine
How do you check to see if an animation is playing in a Sub-State machine?
I'm trying to get specific directional animations playing for a 2D sprite. For example, if the sprite is in the right-up diagonal animation, I'd like to play the right-up diagonal attack animation.
How do I check to see if the right-up animation is playing? It's buried in a sub-state machine. I tried this:
if(this.anim.GetCurrentAnimatorStateInfo(0).IsName("Idle_UpRight")){
if(Input.GetMouseButtonDown(0)){
Debug.Log("Attack right");
}
}
But no luck
Comment
Your answer
Follow this Question
Related Questions
Last frame of animation shows up just before the end 0 Answers
SpriteManager 2 1 Answer
Sprite animation 2 Answers
Animation System in 4.3 1 Answer