Page 1 of 1

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

Posted: Mon Apr 12, 2021 4:04 am
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

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

Posted: Mon Apr 12, 2021 8:13 am
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.

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

Posted: Mon Apr 12, 2021 8:34 am
by KayVen
A-ha! Tried the second option and it works just like I need. Thanks!

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

Posted: Mon Apr 12, 2021 8:51 am
by Tony Li
Glad to help!