GetAnimatorTransitionInfo(0).IsName("Any State -> otherStateName")

Is there a way to get the animator transition info of “Any State” to otherStateName?
I don’t want to code in every single possibility of Any State. Also GetAnimatorTransitionInfo(0).IsName(“Any State → otherStateName”) always returns false - “Any State” is not recognized as a state in itself.

For anyone who still subsequently comes across this problem via search:

If you click on the arrow of a transition in the animator, in this case the transition “Any State → otherStateName”, you will find the exact wording there, which is also used identically for the function GetAnimatorTransitionInfo.

Here you will see that the exact name is not “Any State” but “AnyState” without a space between “Any” and “Space”.

If you then make a call in the code GetAnimatorTransitionInfo(0).IsName(“AnyState → otherStateName”) instead of GetAnimatorTransitionInfo(0).IsName(“Any State → otherStateName”), it will return true as desired.