LookAt() Subtitles in VR

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
theradius1
Posts: 3
Joined: Thu Mar 02, 2023 9:08 am

LookAt() Subtitles in VR

Post by theradius1 »

Hi Tony. I've been working with the dialogue system for the last week and I love it. I just need some help.

I'm creating a game in VR and I'm using the dialogue system as a way to instruct the player how to use the controls in the beginning of the game. I've setup an empty gameobject and called it "Welcome Menu." To the Welcome Menu, I've added the Bubble Template Standard UI Subtitle Panel. This is set to world space.

In the Conversation tab, I've used Dialogue Text to display text on screen, and an audio clip is played from the Sequence using AudioWait each time a node is run through.

What I've wanted to do, is keep the subtitles in an absolute position in the world space. When I put on my headset to test it out, by default, the subtitle bubble follows along, tilting, turning as I move my head. I'd like to make it so that the player can walk up to it, read it, listen to it, and interact with it (pressing continue) while learning their controls.

In order to try and keep these subtitles still, I've made another empty game object, called "Welcome Menu 2" and made this into a third NPC character in the Actors tab. So, we have Player, Welcome Menu, and Welcome Menu 2 listed in the Actors.

I've tried changing the actor and conversant in the Conversation tab, from Player and Welcome Menu, to Welcome Menu and Welcome Menu 2. I figured if I had both of them speaking to each other, neither will move, so then in world space, the subtitles wont move. This is not working, as the subtitles keep facing the camera when I wear the headset.

Then I tried adding a LookAt() method where I wanted to force the Welcome Menu to face the Welcome Menu 2 gameobject, but that isn't working. When I write LookAt(Welcome Menu 2);, it doesn't change. When I write LookAt(Welcome Menu 2, Welcome Menu, ), it doesn't work either. I also tried turning Welcome Menu 2 into a variable and putting the var into the parameters and it doesn't change. However, when I write LookAt(Welcome Menu 2, Welcome Menu, (number)); and put a number in there, it faces towards Welcome Menu 2 for a split second then goes back to facing the camera.

So, my question is, is there a way to keep the subtitles still, in one position, in world space, without facing the camera in the headset? Is my way of solving it a way that will work? Is there a better way? Please help.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: LookAt() Subtitles in VR

Post by Tony Li »

Hi,

The bubble subtitle panel prefab has an Always Face Camera component. You can remove this component to prevent it from rotating to face the camera.
theradius1
Posts: 3
Joined: Thu Mar 02, 2023 9:08 am

Re: LookAt() Subtitles in VR

Post by theradius1 »

Thank you so much! I really appreciate it! I have a feeling this will work, and I would love to try this to see but now for some reason after I unticked the Always Face Camera component the subtitles are disappearing. I put them back on and no change. I've tried zooming out and looking to see if the canvas enlarged or moved, but it's still in the same place. I tried searching through the forum. I got rid of Hide and Show for the Show Animation Triggers, then put them back, then made sure Visibility is Always From Start. But it keep still keeps disappearing.
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: LookAt() Subtitles in VR

Post by Tony Li »

Hi,

Is the bubble background image visible? Or is the entire thing hidden?

If the bubble background image is visible but the text is not, check the Text / TextMeshProUGUI component. Is its RectTransform a strange size (e.g., too small to hold text), or color transparent, or component disabled? Does the Text field contain the subtitle text? If not, are you using a typewriter effect?

If the entire thing is hidden, inspect the subtitle panel and look at the Animator window. Is it in the expected animation state (e.g., Show)?
theradius1
Posts: 3
Joined: Thu Mar 02, 2023 9:08 am

Re: LookAt() Subtitles in VR

Post by theradius1 »

Thank you so much for helping me out. I've spent most of this week just on the boards, looking up threads in the forum, reading the manual, and watching videos on how to learn this thing. Running into the problem with the subtitles was when I just had to finally reach out to you. Your help means a whole lot.

It was the last thing you pointed out, which was due to the whole subtitle being hidden. I went into the animator window and saw that Entry was connected to Start, but Start was not connected to Show. I have no idea how that happened because I wasn't even using the animator window. Once I connected Start and Show, the subtitles starting showing up again. But they would appear for a split second, then disappear, then fade in. When I got rid of Show in the Bubble Template Standard UI inspector, it would finally fade it without showing for a split second. The only downside is that the button I have on it shows first, then the subtitle UI and text fade in. However, I tried out unticking the Always Face Camera component and it works!
User avatar
Tony Li
Posts: 21684
Joined: Thu Jul 18, 2013 1:27 pm

Re: LookAt() Subtitles in VR

Post by Tony Li »

Hi,

Great! Happy to help, and glad it's working.
Post Reply