Page 1 of 1

How do I activate Bark text when the enemy gets hurt?

Posted: Tue Aug 08, 2023 3:30 pm
by totosavi
Hi guys! I'm not sure if this question has been asked before, but I'm trying to find out how to activate Bark whenever the enemy gets hurt by the player. Does anyone know how to do this?

Re: How do I activate Bark text when the enemy gets hurt?

Posted: Tue Aug 08, 2023 5:00 pm
by Tony Li
Hi,

You first need to have a way to know when the enemy gets hurt. When it gets hurt, you can either bark in code, using a string:

Code: Select all

DialogueManager.BarkString("Ouch!", enemy);
or, to bark random lines from a conversation:

Code: Select all

DialogueManager.Bark("Enemy Hurt Barks", enemy);
Or you can set up a Dialogue System Trigger on the enemy. Set its Trigger to OnUse. Select Add Action > Bark, and configure the bark. When the enemy is hurt, call the Dialogue System Trigger's OnUse() method.

Re: How do I activate Bark text when the enemy gets hurt?

Posted: Tue Aug 08, 2023 5:35 pm
by totosavi
Thank you Tony! It worked :D

Re: How do I activate Bark text when the enemy gets hurt?

Posted: Tue Aug 08, 2023 8:16 pm
by Tony Li
Glad to help!