Cancel conversation when walking away?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Cancel conversation when walking away?

Post 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!
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cancel conversation when walking away?

Post 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.
Hereder
Posts: 76
Joined: Mon Dec 21, 2020 2:53 am

Re: Cancel conversation when walking away?

Post 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
User avatar
Tony Li
Posts: 21977
Joined: Thu Jul 18, 2013 1:27 pm

Re: Cancel conversation when walking away?

Post by Tony Li »

Glad to help! Yes, prefabs and prefab variants are handy.
Post Reply