I normally use the animation controller for animating my objects however this use case requires the animation to be able to play any animation from quite a large list and thought the animation component would be easier as it doesnt use the node view.
The problem is pretty much as it sounds, i have set up the animation component so i could .play whichever animation i needed without having to work with the nodes.
And it works, if i put an animation clip in, wether its in editor, runtime, or inspector, it works just fine, except it does not do anything to change the SpriteRender Sprite property. I have animated it the exact way I have done for position values, even the SpriteRenderer Colour property (in the same animation clip as the one being used to change the sprite), and it works fine. However if i put a SpriteRender Sprite on, nothing happens to change the sprite, everything else will continue to work fine but the Sprite doesn’t change.
I have looked at the Animation Component documentation and followed the how to (Animate a GameObject with the Animation component • Unity Studio • Unity Docs) and no where does it mention that it cannot be used to change the SpriteRenderer sprite. I have tried legacy and non legacy animations and, same thing, works for everything except updating the sprite, some guidance would be appreciated.




