Hi All,
Let’s say you have an Animator that has ‘Any State’ transitioning to 10 animations and has multiple conditions to evaluate for each one. Let’s also say that each transition has 7-10 conditions and IsGrounded is a condition that is required for each one.
Does the animator essentially check for IsGrounded 10 times - once for each transition? Essentially, is each transition its own unique IF/AND statement or does it have a way of not retesting the same conditions in the same frame? i.e. Would it only test IsGrounded once in a frame and use that result for all relevant transitions?
Thanks!
Hi,
Animator controller condition are really basic, for each transitions all conditions are re-evaluated. Caching the result of a bool in another bool won’t give you any benefit in this case … unless each condition evaluation invalidate the cache but this is never the case for animator properties since they are all stored in the same memory block and transition evaluation has a really good cache locality.
Computing IsGrounded and setting the results into the animator properties is probably what take more CPU time. But once the results is commited into the animator’s properties, it only a bool comparaison at this stage.
Best regards
Thanks so much for the response!!!
So, in this example, would it be more performant/efficient to just set the 7-10 parameters on each transition and let the animator handle, rather than precomputing a unique ID and just sending that one parameter into each transition??