Reputation: 2882
I ought to have a normal map of tiles as below:
But when I load the scene, either switch from another in inspector (e.g. click "scene/menu", then click this scene), or transit into this scene in gameplay (SceneManager.loadScene
), sprites get invisible randomly.
Each time some of the sprites get invisible, and the next time the invisible ones may not be the same. I suspect it is something with Unity editor, since this happens even when I'm not in playing mode.
In Debug.Log
I definitely find those sprites (not null). They just don't show up. I have to reload sprites / reload the scene in Unity inspector, but the load doesn't persist.
Neither sprites, SpriteRenderer nor GameObject is null
.
As below is a snapshot when some sprites invisible (not missing):
Just click another scene and switch back:
Upvotes: 1
Views: 674
Reputation: 2882
I just accidentally checked in 3D mode, Unity editor is randomizing with z
axis. The sprites are there, they were just hidden behind background. This can be fixed then.
Upvotes: 1