Let’s say we need to execute a death animation
What’s the difference between implementing a trigger on a transition from “Any State” to the death animation,
and calling the death animation directly using “Animator.Play” without linking it to anything else?
Thank you.
It’s functionally the same.
But I’d suggest using Animator.Play or Animator.Crossfade. In a sufficiently large project, you’ll eventually end up in a weird case where one of your AnyState transitions will trigger for weird reasons, and you’ll have a hard time figuring out why.
With Play and Crossfade, you can rapidly do a search through your code and add breakpoints in every place where it happens.
To a certain extent, that’s also true of every other transition, but at least those are limited to a single source state, whereas AnyState transitions can happen from every state.
3 Likes