How to have one speech bubble with updating text?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
andreas.leurs
Posts: 10
Joined: Wed Jun 25, 2025 7:40 pm

How to have one speech bubble with updating text?

Post by andreas.leurs »

Is it possible that the NPC gets a speech bubble and the text is updating very X seconds?

I want a NPC sleeping on the ground and he is counting sheep in his sleep. I think in this case the best way to do that is that I Show the SpeechBubble myself and update the text in it myself and don't use something like StartConversation() or Bark().

Also: Can I put an image in the dialog (speech bubble)?
User avatar
Tony Li
Posts: 23359
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have one speech bubble with updating text?

Post by Tony Li »

Hi,

A conversation or a bark will work for this. If you control it all from a script, use barks. Example:

Code: Select all

int count = 0;
while (isPlayerAwake)
{
    count++;
    DialogueManager.BarkString($"{count} sheep", player.transform);
    yield return new WaitForSeconds(2);
}
If you know the maximum number of sheep, you can create a conversation with that many dialogue entry nodes. Then play it. If you want the text to appear overhead, see: How To: Show Overhead Conversation Bubble Text. To show images, use TextMesh Pro and <sprite> tags.
andreas.leurs
Posts: 10
Joined: Wed Jun 25, 2025 7:40 pm

Re: How to have one speech bubble with updating text?

Post by andreas.leurs »

Thanks that works like a charm.

I only had to add a Dialogue Actor to the NPC with a Bark UI to make it work.
User avatar
Tony Li
Posts: 23359
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to have one speech bubble with updating text?

Post by Tony Li »

Great! Glad to help.
Post Reply