- Home /
Disabled sprite renderer's briefly show on level load
I have a Unity 2D scene consisting mainly of Sprites. I have disabled the sprite renderer for several of these sprites because they only show up when the player takes some action. My issue is when Unity loads the level, these sprites briefly show up 'flashing' onto the screen before they are hidden. Is there any way around this?
Are these sprites dynamically generated or altered by script? Try recreating the objects you are having trouble with. Also, check if this is an issue after building. Some issues can be fixed with a restart of Unity.
The sprites are not dynamically generated. I dragged them into the scene and unchecked the "sprite renderer" component to disable it.
Answer by andrewow · Aug 26, 2014 at 04:01 AM
For the record, the way I ended up solving this was a bit of a hack. I made a black sprite on top of everything (on a "Frontmost" sorting order layer) which would fade out then destroy when the scene was loaded. Since it's the frontmost sprite, it covers up the flashes of the other sprites.
Answer by gcoope · Jul 30, 2014 at 10:30 PM
Try and hide them in the Awake() function if you aren't already, instead of Start() which would usually make sense.