Page 1 of 1
Disable conversation when player walks away?
Posted: Mon Feb 01, 2021 5:23 am
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
Re: Disable conversation when player walks away?
Posted: Mon Feb 01, 2021 9:02 am
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.
Re: Disable conversation when player walks away?
Posted: Wed Feb 03, 2021 4:30 pm
by nicmar
Oh those sound like two great options, thanks!
Re: Disable conversation when player walks away?
Posted: Wed Feb 03, 2021 4:45 pm
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.