Background won't load

I’ve re-purposed some assets from the one way platforms example by @britzl and I have encountered an issue. I have created a new background png and loaded it into the collection and atlas. I can see it in both but in the built version of the game it does not appear.

any ideas?

By default the renderscript renders between z: 1 to z: -1
Check if your background gameobject (or sprite) is positioned outside these values.
The Editor view is not limited in such way.

4 Likes

This definitely seems like a Z-order issue, where your background’s sprite z-value is set either

  1. Too high, i.e. >1, so it is not rendered at all.
  2. Lower than the other objects, so they are rendered above your background.

Since it does not render at all, if I understand you correctly, even in places where there are no objects, the first one seems to be the culprit. Double check all relevant z-values; remember that if your background game object (bg) has z-value 1, and its sprite (sprite) also has z-value 1, then the sprite will not be rendered, as the sprite will then have z-value 2, and hence will not be rendered.

2 Likes