So, I have a sprite animation that sets SpriteRenderer.FlipX = true, and as expected, the animation flows flawlessly...
When the animation ends, FlipX is set back to false... there is no script call no nothing, it's just reset.
So I tried using OnStateExit to ensure that after the animation FlipX would be set to true. After coding the calls and checking that they are called, I see that the inspector keeps showing FlipX "unchecked", the property is set to true and the sprite appears unflipped.
Then I tried doing the same thing using animation events, same result.
After that, I tried just clicking the #@&$# checkbox, and guess what? It doesn't work, the box isn't greyed out, it just keeps unchecked and clicking it does not flip the sprite (with the game running or not). Clicking FlipY works perfectly...
I guess that something in mecanim is holding the FlipX property, does anyone have any idea on how to fix this? I just wanted FlipX to stay checked after the end of the animation. I am using root motion and all the other properties keep their values ok.
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
145 People are following this question.
Unity Sprite renderer bug??
Need to make a fake 2D shadow mask shader
How do i get my character to move
New Unity3d 2d sprite Renderer Feature not available
How do you access Sprite renderer flip in a script?