Let’s say I want State 1 to transition to State 2 when ExitTime is after 0.5 and int parameter “State Index” is 0. Unless I am mistaken, this is impossible in Mecanim.
If “State Index” becomes 0 when ExitTime is 0.51, then the whole animation state will have to loop once before the transition executes, because ExitTime must be exact.
Can anyone help me think of a workaround for this stupefying limitation?
Thanks for your reply, MrEastwood. Doesn’t this then mean that there needs to be a script component added for every transition, if the required ExitTime and StateIndex varies per state? Nightmare!
If this is a condition you need regularly i would not use a boolean but a float instead. In this float your helper scripts stores the normalizedTime that you ironically get from the animator itself. The trick is that you can now use normalizedTime as a condition in each transition that needs it. This differs from using Exit Time, because the Exit Time condition is only met at that exact time, but our normalizedTime variable can be used with the “greater than” and “less than” evaluations.
Ooh, clever. So you’re feeding the animator a value that it already technically knows about but can’t normally use (“normalizedTime”).
It makes me peeved that ExitTime can’t simply have a Greater / Less / Equals pulldown like any other float condition, but this is a great, simple, and very silly solution. Thanks!