knh190
knh190

Reputation: 2882

Unity - Sprite not properly loaded

I ought to have a normal map of tiles as below:

enter image description here

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):

enter image description here

Just click another scene and switch back:

enter image description here

Upvotes: 1

Views: 674

Answers (1)

knh190
knh190

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

Related Questions