Blinking Animation - Sprites inside Animator won't show in Scene / Game

Hi everyone!

Just testing out 2D in Unity. I am followin a tutorial that uses Sunnyland.
I pretty much followed the tutorial but when adding animations something weird happens: I drag the player sprites for the animation into the Animation window. The keyframes are added and I can see the right pictures under the frames. but when I play the animation some frames are empty wich leads to a blinking animation. Funny enough this step is not reproduceable with every scene! Some scenes use some animations correctly, other have them missing. Now some pictures to show what I mean:
5187893--515528--upload_2019-11-18_19-14-26.png
Landing sprite is there

5187893--515531--upload_2019-11-18_19-15-16.png
Sprite to start the jump is missing

For both spritesthe following settings are applied:
5187893--515534--upload_2019-11-18_19-15-59.png

Thanks for every hint. Couldnt find anything so far using google with some keywords like ‘blinking animation unity’ and so on.

1 Like

Hello Scythwolf,
How does your player GameObject look like? Could you share a screenshot of all the components it has?

If you select all the sprites included in the animation, and drag them out into your scene view, you will auto create a new sprite animation. You could try this to see if the new animation also has the same blinking issue as you are encountering.

1 Like

Hi Ted!
Thanks for your fast reply. Here is a screenshot of the components. Since there are a few of them it would need several screenshots to display all of them. Let me know if that is needed (didnt wanna spam them).
5190419--515846--upload_2019-11-19_12-8-50.png

If I drag them into the scene a new GameObject appears. On the sprite renderer - Layers it bring it in front of everything. Still the same issue: First sprite not visible.
What I find astonishing is the fact that the sprites, that are not visible, are not consistent. For example I followed your advice dragging the sprites and recreated a running animation. Now two different sprites are not visible.

But I got an error now as I just saw:

UnityEditor.AssetDatabase:LoadMainAssetAtPath(String)
UnityEditorInternal.AnimationWindowUtility:CreateNewClipAtPath(String) (at C:/buildslave/unity/build/Editor/Mono/Animation/AnimationWindow/AnimationWindowUtility.cs:997)
UnityEditor.SpriteUtility:CreateAnimation(GameObject, Object[ ], ShowFileDialogDelegate)```
1 Like

Thank you for sharing! What version of Unity are you using? And could help us by creating a small project which isolates this issue, zip it up and attach it to this thread? Then we can have a look to see what goes wrong.

Thanks in advance!

1 Like

Opened the project today and despite my screenshots I provided there is no blinking anymore. Tried to reproduce it in a new scene - everythings working right now, also I would not get this error message anymore.
Funny though since I didnt change anything inside the project since posting. If this blinking comes up again, I’ll post to this thread.

Unity version is 2018.4.5f1

1 Like

Software magic! I am happy that it started to work again, but yes, if you start experiencing this issue again, please send a small project with the issue over, and we will have a look.

1 Like

Hi, I just had the same issue in Unity 2019.3.2f1. In fact, blank sprites are well displayed but for some reasons it appears behind the background, while some don’t. Changed the “Sorting Layer” of the Sprite Renderer and everything worked well. :slight_smile:

2 Likes

Encountered the same problem. I think the issue is on the Order in Layer, i changed the background’s order in layer to a negative number and everything worked perfectly fine

4 Likes

actually, there is an option in the sprite renderer called additional settings. Under that, there is the “Order in Layer” option. If it is 0 change it to 1. it is actually a Z-fighting as the background and sprite is in the exact same position.

3 Likes

Thank you, this forum’s post made me realize that somehow after exporting some asset package, my background image sorting’s layer value is changed, so it has higher priorities than my player’s sprite.

1 Like

Me too, thank you Google.