How to trigger Bark using Visual Scripting?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
ZBD
Posts: 2
Joined: Fri Jul 11, 2025 11:21 am

How to trigger Bark using Visual Scripting?

Post by ZBD »

Hi! I've been pulling my hair trying to make a character bark using Visual Scripting.

I have a conversation with four barks. I want to have this character emit one of the four lines at the end of this subgraph.
Image

Inpsector for the character that emits dialogue.
Image

The current visual script subgraph containing the bark nodes that are not working.
Image


Here is what the speech bubble looks like when using the Bark on Idle component.
Image
Right now, the speech bubbles do not appear.

Currently using Unity 6 and the latest Visual Scripting.

Anything helps, thanks!
User avatar
Tony Li
Posts: 23416
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to trigger Bark using Visual Scripting?

Post by Tony Li »

Hi,

Here are two ways:

1. Set up a Dialogue System Trigger and invoke its OnUse(Transform) method. In the screenshot below, I put a Dialogue System Trigger on the visual script machine's GameObject and added a bark UI prefab as a child. I set up the Dialogue System Trigger's Actions to bark.

barkVisualScriptingDialogueSystemTrigger.png
barkVisualScriptingDialogueSystemTrigger.png (11.2 KiB) Viewed 42 times

2. Or get a reference to the Dialogue Manager's Dialogue System Controller component and call its Bark method. In the example below, I added an "NPC" named "Capsule", added a bark UI prefab as a child, and set up the script machine to call the DialogueSystemController's Bark() method.

barkVisualScripting.png
barkVisualScripting.png (33.29 KiB) Viewed 42 times
ZBD
Posts: 2
Joined: Fri Jul 11, 2025 11:21 am

Re: How to trigger Bark using Visual Scripting?

Post by ZBD »

First option solved it! Thanks!


It would be even more helpful in the future if I could find more documentation on accessing these functions through Script Graph.
Post Reply