Problem with Layer Order

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
allisonrose
Posts: 32
Joined: Wed Nov 14, 2018 8:27 pm

Problem with Layer Order

Post by allisonrose »

Hey! This may be a really dumb question, so forgive me for overlooking the obvious solution. I'm still learning Unity as I go along.


I'm having issues with game objects in my scene not showing up when the Background layer is active. (I'm using the VN framework)

I have two objects on my stage - One character model (using Live2d) and another random sprite just for testing to make sure this issue isn't specific to the live2d prefab object.
Image

When I test the game with the background layer turned on, it covers up the game objects completely. I have attempted to try out different sort layers (UI, Default, even a custom sort layer)and it doesn't seem to make a difference. I have also tried putting my game objects IN the background canvas, but they don't show up at all then.
Image

This is an image of a test run with the background image turned off. Everything shows up fine. But ideally, I'd like to use the background field, so this creates a bit of an issue.

Image


Any ideas on what I'm missing? Thanks in advance!!
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem with Layer Order

Post by Tony Li »

Hi!

The Background Canvas's Render Mode is set to Screen Space - Overlay. This makes it draw on top of any non-UI elements in the scene, such as SpriteRenderers.

Change the Background Canvas's Render Mode to Screen Space - Camera. Assign the scene's camera. Make sure your camera is set to Orthographic. The Canvas's Plane Distance is 100, which should place it well behind any sprites you put in the scene.
allisonrose
Posts: 32
Joined: Wed Nov 14, 2018 8:27 pm

Re: Problem with Layer Order

Post by allisonrose »

Great!!
Thanks once again (and probably a million more times in the future) for being so patient and helpful!
User avatar
Tony Li
Posts: 22056
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem with Layer Order

Post by Tony Li »

Always happy to help!
Post Reply