Disable conversation when player walks away?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Disable conversation when player walks away?

Post by nicmar »

Is there any built in component to disable a conversation when the player walks too far away from the person he's talking with? I'm allowing the player to move in a conversation.

Thanks :)
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable conversation when player walks away?

Post by Tony Li »

Hi Niclas,

Yes. Tick the Dialogue System Trigger's Stop Conversation On Trigger Exit or Stop Conversation If Too Far.

Stop Conversation If Too Far will monitor the distance between the Dialogue System Trigger's GameObject and the GameObject assigned to the Conversation Actor field.

Stop Conversation On Trigger Exit will stop the conversation if the actor or conversant trigger a Unity OnTriggerEnter or OnTriggerEnter2D event. For this option, you must add a trigger collider to the Dialogue System Trigger and make sure it's on a layer that will register trigger events with the player.
nicmar
Posts: 133
Joined: Wed Aug 21, 2019 2:39 am

Re: Disable conversation when player walks away?

Post by nicmar »

Oh those sound like two great options, thanks!
Working on SpaceChef - A wacky open world space western, featuring a chef with nothing to loose, after he loses everything.. ;) Follow our work on @BlueGooGames.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Disable conversation when player walks away?

Post by Tony Li »

Glad to help!

Of course, if you want to manage it yourself instead of using those automated options, you can call DialogueManager.StopConversation(); in C# whenever you want.
Post Reply