Page 1 of 1

How to have one speech bubble with updating text?

Posted: Mon Jun 30, 2025 7:57 am
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)?

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

Posted: Mon Jun 30, 2025 9:40 am
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.

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

Posted: Mon Jun 30, 2025 4:05 pm
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.

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

Posted: Mon Jun 30, 2025 4:13 pm
by Tony Li
Great! Glad to help.