Subtitle UI to always face camera in 3D above other elements

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
KayVen
Posts: 13
Joined: Mon Apr 12, 2021 1:58 am

Subtitle UI to always face camera in 3D above other elements

Post by KayVen »

Hello!
I apologize if this issue has been discussed already or if it's very simple and I'm just missing something so obvious :( :D
I am working with AC in 3D scene. My goal is to have dialogue subtitles floating above characters, but of course always facing the camera and being on the top of everything else in the scene.
I have modified example bubble subtitles and implemented them. However I'm not exactly sure how to have them stay above the character's head in the 3D space.
Image

Image

I thought that simply changing the layer of examble bubble UI would help, but with no success :c
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle UI to always face camera in 3D above other elements

Post by Tony Li »

Hi,

Since the bubbles are in 3D space, they can be blocked by other objects that are closer to the camera in 3D space.

There are two options:

1. Use a screen space bubble UI (see the ScreenSpaceBubbleExample on the Extras page).

2. Or use a separate camera for subtitles. It's fairly simple to set up:
  • Change the bubble's layer to UI (or a layer of your choosing).
  • Inspect your camera, and add a new camera as a child. Set the new camera's position & rotation to 0,0,0 so it matches the position and rotation of the main camera.
  • On your main camera, remove the UI layer from the Culling Mask.
  • On your child camera, set Depth to a value higher than your main camera, and set Culling Mask to only UI.
KayVen
Posts: 13
Joined: Mon Apr 12, 2021 1:58 am

Re: Subtitle UI to always face camera in 3D above other elements

Post by KayVen »

A-ha! Tried the second option and it works just like I need. Thanks!
User avatar
Tony Li
Posts: 22047
Joined: Thu Jul 18, 2013 1:27 pm

Re: Subtitle UI to always face camera in 3D above other elements

Post by Tony Li »

Glad to help!
Post Reply