Page 1 of 1

Cancel conversation when walking away?

Posted: Wed Jun 15, 2022 4:57 am
by Hereder
Hi!
Is it possible to cancel/turn off a conversation when walking away from an NPC? (A 2D game)
I believe I accidently did this in my previous game but can't figure out HOW.
I've got the following things attached to the Player, NPC and Manager.

The Player has:
Proximity Selector

The NPC has:
Dialogue System Trigger
Dialogue Actor
Usable

And the DialougeManager Has:
Dialogue System Controller
Input Device Manager
Dialogue Input
Dialogue System Events

Where, if possible do I make it possible to cancel/turn off a conversation if the player decides to walk away while talking?
Thanks!

Re: Cancel conversation when walking away?

Posted: Wed Jun 15, 2022 7:43 am
by Tony Li
Hi,

The Dialogue System Trigger component gives you two options to do that:

Stop Conversation On Trigger Exit: Add a trigger collider to the NPC. If the Conversation Actor (i.e., player) leaves the trigger collider, it stops the conversation.

Or:

Stop Conversation If Too Far: While the conversation is active, it monitors the distance between the NPC and player. If it exceeds the max allowed distance, it stops the conversation. Note: This option does a 3D distance check. In a 2D game, make sure the player and NPC position's Z values are similar so it only measures X-Y distance.

Re: Cancel conversation when walking away?

Posted: Thu Jun 16, 2022 3:31 am
by Hereder
Thank you! "Stop Conversation On Trigger Exit: " this worked best - But I have to add it to all covnersations >_< Lucky I made them all prefabs :D

Re: Cancel conversation when walking away?

Posted: Thu Jun 16, 2022 8:11 am
by Tony Li
Glad to help! Yes, prefabs and prefab variants are handy.