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:
Landing sprite is there
Sprite to start the jump is missing
For both spritesthe following settings are applied:
Thanks for every hint. Couldnt find anything so far using google with some keywords like âblinking animation unityâ and so on.
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.
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).
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.
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.
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.
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.
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.
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
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.
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.