Screenspace Bubble Example edit

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
mindjar
Posts: 12
Joined: Tue Aug 06, 2019 11:22 am

Screenspace Bubble Example edit

Post by mindjar »

I've made floating speech bubbles in my game, but right now I need to have them in a world space and for put a canvas in each of the character game object. I don't think it's an optimal solution.
Here' a video - https://www.youtube.com/watch?v=6JWEm4GHcAA

I wanted to switch to screenspace solution and edited the "Basic Standard Dialogue UI". Everything works, but to position the bubble over the character's head I need to access the actor's game object transform position. How to get the game object of current actor/conversant via script?
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Screenspace Bubble Example edit

Post by Tony Li »

Hi,

The Dialogue System Extras page has an example screen space bubble UI. Go to the page and search for "ScreenSpaceBubbleExample". The example uses a canvas for each speaker, but you can adapt it to use a single canvas for everyone.

If you're using an OnConversationLine(Subtitle) method, the current speaker's transform is subtitle.speakerInfo.transform.

Otherwise, you can check DialogueManager.currentConversationState.subtitle.speakerInfo.transform.
Post Reply