Dialogue UI -- Sorting Layers?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Dialogue UI -- Sorting Layers?

Post by nathanj »

Hi Tony and Everyone,

I'm stumped with a new issue. I've started rendering our DS in World Space. Everything seems to be working except I can not figure out how to get the dialogue windows to render on top of our world objects. For example, I i initiate a conversation with an NPC who is standing beside a tree part of their dialogue text is visible while another part is hidden behind the tree. I thought "sorting Layers" would help but that doesn't seem to make any difference.

DOes anyone have any suggestions?

Thanks again,
Nathan
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Dialogue UI -- Sorting Layers?

Post by nathanj »

One other thing.

I've noticed that depending on the camera angle used, during conversation sequences, the dialogue text looks like it is rendered at different sizes. I know that this is simply a perspective issue, but if I use different camera angles for different characters and scenes it will result in subtle differences in the appearance of the dialogue text.

is there a way around this? say, to have text always appear one size while being rendered?
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue UI -- Sorting Layers?

Post by Tony Li »

Hi Nathan,

You'll need to use two cameras. The first camera will render world GameObjects, and the second camera will render UI GameObjects on top. Here's one way to set it up:

1. Inspect your current camera GameObject. Click the Culling Mask dropdown and uncheck the UI layer.

2. Add a child GameObject. Inspects its Transform component and select gear menu > Reset to put it in the same position at the parent.

3. Add a Camera component to the child. Set its Depth to a higher value than the parent camera. The parent's Depth is probably 0, so you can set this one's Depth to 1. Then click the Culling Mask dropdown and check only the UI layer.

For the perspective issue, try adding an Always Face Camera component to your dialogue UI's Canvas.
Post Reply