Home > Mobile >  IsTag() only returns true for a couple of the many frames rendered while an animation with that tag
IsTag() only returns true for a couple of the many frames rendered while an animation with that tag

Time:01-21

I am trying to check if an animation (started by using SetTrigger("") is still running or has finished. Each of these animations have the tag "Attack", but running

animatorReference.GetCurrentAnimatorStateInfo(0).IsTag("Attack")

returns true only once for a brief moment during the whole time the animation is playing (it returns false the rest of the time), and at the end of the animation. Does the IsTag() function just not work or am I majorly overlooking something?

I have tried changing the name of the tag as well as manually hashing the string "attack", but it still only returns a hash of "attack"/only returns true once each time an animation is run, at the end of the animation.

CodePudding user response:

While I had not tested it directly it is logical (and you proved me right) that if an animation is having a transition and blending 2 animations together it is not necessary going to be under the name of the one animation. Nor is the animation going to make it to 100% because it will have transitioned onto the next by then.

  • Related