i’ve been fighting this system for several weeks now, if not months. sometimes i have had working animation for my sprite, sometimes i have not (settrigger worked for awhile then the hash system went haywire; animator.play worked for awhile until i added in new animations then it got confused). i tried legacy, but after finding a glitch that i only could have found by setting my inspector to debug (in order to set my clips to legacy), i decided to give Mecanim another shot
if i’m in game view and i set Direction to whichever number, it plays the animation once correctly. however, my code does not play anything correctly. instead the character spazzes out for a few seconds after i start the game (playing animations randomly), then no animations play no matter what i do.
either unity doesn’t treat 2d animation carefully or there’s something buggy somewhere. i could really use help! i thought i had it fixed finally after deciding to use parameters, but i was mistaken
You need to ask specific questions if you want assistance. “I do not understand” does not provide people any base to start with. What exactly do you not understand?
I’m fairly familiar with the system, the thing is I mostly used it for 3d, and not 2d.
For 2d/billboard sprites I rolled out my own system.
Can you post your code? (Please use [ code ] tags.) Since the animation plays correctly when you set the Direction parameter in the Animator window, it sounds like Mecanim is working correctly. Your script might just need a little adjustment.