Another reason to has the animation's name

Not only is it more efficient to refer to the hash value because internally it only needs to work on an int instead of a string, but there’s another benefit to it.

If you use the animation’s name to play it and have a typo, the animator will simply do nothing (except writing a log message to the console).
But if you refer to it with a hash value, you will get an error instead which makes tracking down the reason why the animation didn’t play much easier to do.

Privacy & Terms