I have a 2D character with animations made with Unity's animation tool.
I am trying to change a sprite from script, in that character. The problem is that once the sprite is changed, it switches back to the original sprite the next frame.
This problem occurs on my Idle animation, even though the "idle" animation does NOT change the sprite.
However, other animations within the character's Animator do change that sprite.
The problem on "idle" disappears when I delete this sprite's property in the OTHER (non-active) animations.
How come OTHER animations' properties override my Idle animation?
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
The best place to ask and answer questions about development with Unity.
To help users navigate the site we have posted a site navigation guide.
If you are a new user to Unity Answers, check out our FAQ for more information.
Make sure to check out our Knowledge Base for commonly asked Unity questions.
If you are a moderator, see our Moderator Guidelines page.
We are making improvements to UA, see the list of changes.
Answers and Comments
77 People are following this question.
2D Animation does not start
Help with the animation window?
Marked as "Legacy" ?
Can Animator.MatchTarget and AvatarTarget be used for generic rigs?
Using root motion scripting for specific animations