Sprite disappears after running

I’ve worked with Unity for awhile, but I’m trying to switch over to Linux. It’s possible I’m missing something completely.

To reproduce:

  • Create a new 2D project.
  • Add a sprite to the scene (any shape)
  • (Optional) Click on the camera in the editor to see that the preview shows the sprite
  • Run the game
  • See that the sprite disappears.
  • Quit the game.
  • See that the sprite is still no longer being rendered in the editor (though the game object itself still exists).

Any ideas?

Found a quick fix: It looks like the default material is set to “None (Material)”. Clicking the change button and changing it to “Sprites-Default” causes it to re-render and then it stays rendered. I don’t remember having to do this with the Unity in Windows or OSX .

1 Like

I know this is old, but it was near the top result. To fix it, I had to delete the sprites and start over. Maybe deleting the renderer and replacing it would work? I had 1 sprite and 3 empties with a collisionbox just vanish.

I had to delete the sprites out of my animations to get it to show up

hi I also have this same error I set the sprites to sprites-default and still the same error is showing does anyone know the solution. The sprite only disappears after I hook the sprite with code I Re-Checked the code 10 Times and No solution Please Anyone Help me

2 Likes

Can you reproduce this behavior on Windows or does it only happen on Linux?

Can you reproduce the same behavior if you build and run a standalone player?

A bit of a necro on this post, but when you are coding be careful not to change any Image’s alpha directly through the material. It’s easy to grab the global material by mistake. And if the Image component has no material then you will be unknowingly modifying the Unity default sprite material asset, affecting all sprites even when you stop play…

a mi me aparese este error en la consola
Posición de la pantalla fuera de la vista frustum (pantalla pos 728.000000, 130.000000, 0.000000) (Cámara recta 0 0 1139 457)
UnityEngine.GUIUtility rocessEvent (int,intptr,bool&)
no se que hacerme solo me detecta la colición pero no aparese el personaje en Sprite renderer no me sala la imagen cuando ejecuto el juego solo aparese cuando no lo estoy ejecutando podrian ayudarme