- Home /
hash does not exist error
so i'm getting this error "hash [number] does not exist". i'm using the stringtohash method of animating my walk sequences, found here: https://unity3d.com/learn/tutorials/topics/animation/animator-scripting?playlist=17099
originally, i had no problem with the hashes. then i redid all my animations, and renamed everything including the ints holding the hash values, and that's when i started getting this error. only with some of the animations though, for example walk left works fine but walk right gives the error.
after i redid my animations, i reset everything i could think of and rebuilt the solution in Visual Studio, but no luck.
i am sure that the names i use in code and those in the animator are the same, so that's not the problem. i don't know of any other way to animate my characters, so i'm stuck until this is resolved. :(
now i'm just using animator.Play("...") so i am not in urgent need of help. but this still appears to be an issue if you wanted to use StringToHash for some reason.
You said you are sure that the names are equal, but it's most likely that they are not equal. Note that casing does matter when you create a hash. The names have to be 100% the same. No leading or trailing characters, no additional or missing spaces, ...
We can't really help you besides saying that you most likely do have a different parameter name in your code as you have in your animation.
Answer by koralturkk · Nov 08, 2020 at 02:11 PM
The problem you are facing comes from a misunderstanding. SetTrigger looks for animation parameters not for the animation itself. So you should set up a parameter which invokes a specific animation and then access it via hashcode, trigger it and then you'll see your animation being played.