Problem On Trigger Exit when leaving Conversation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
juanchodeth
Posts: 8
Joined: Fri Feb 11, 2022 1:55 pm

Problem On Trigger Exit when leaving Conversation

Post by juanchodeth »

Hello! I've been struggling all day with this
The problem is that, some of my npcs, when the conversation starts on trigger enter and the player leaves the trigger, they won't stop their conversations. They are identical to others that work well so...
They all have checked the "Stop Conversation On Trigger Exit" and the Dialogue manager registers the OnTrigger Exit Event, so don't know where is the issue.
Attacking an screenshot that may help understand the problem.

Thanks.

https://gyazo.com/770c3e46ab206e43abeb47fa7536c236
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem On Trigger Exit when leaving Conversation

Post by Tony Li »

Hi,

The 'Stop Conversation On Trigger Exit' checkbox stops the conversation if the current actor or current conversant leaves the trigger collider that's on the Dialogue System Trigger's GameObject.

Things to check:
  • The Dialogue System Trigger has a trigger collider. It may also need a rigidbody (kinematic is usually ok) and will need to be on a layer that registers collisions with the current actor/conversant's layer. You can check the collision matrix in Edit > Project Settings > Physics2D.
  • The current actor or current conversant must have a collider so it can register OnTriggerExit with the Dialogue System Trigger. In your screenshot the current actor will be the GameObject named 'Conversation'. Normally the actor is the player, and the conversant is the NPC. Since the Dialogue System Trigger's Conversation Conversant is unassigned, it will look for a GameObject with a Dialogue Actor set to the conversation's Conversant in the Dialogue Editor. If it doesn't find one, it will use the Dialogue System Trigger's GameObject. You may want to leave the Conversation Actor field blank if the player has a Dialogue Actor, or assign the player to it if the player doesn't have a Dialogue Actor. More info.
juanchodeth
Posts: 8
Joined: Fri Feb 11, 2022 1:55 pm

Re: Problem On Trigger Exit when leaving Conversation

Post by juanchodeth »

Setting the actor as null and putting the npc on conversant seems to work in this case, but the other npcs that worked before, were working like that, and still working nicely.
It's confusing to me that this works, as in my game the player is almost always silent and the npcs are the ones that speak, so the logic tells me to set the npc as actor and the player as conversant.

Anyways thanks for your help!
User avatar
Tony Li
Posts: 22107
Joined: Thu Jul 18, 2013 1:27 pm

Re: Problem On Trigger Exit when leaving Conversation

Post by Tony Li »

Sounds like it's working now. But if you'd like to get a clear understand of why, please see below.

Every conversation has an actor and a conversant. They're shown in watermarks in the lower right of the Dialogue Editor's conversation canvas and in Menu > Conversation Properties. These represent the primary participants in the conversation. The actor is usually set to the player character.

Every dialogue entry also has its own actor and conversant dropdowns -- but this terminology is confusing because in this case the dialogue entry "actor" is really the speaker, and the "conversant" is the listener (the character that the speaker is addressing).

In your case, I'm guessing that the conversation's actor = Player and conversant = some NPC. And all of the dialogue entry nodes' actor dropdowns are set to the NPC.

To understand how this lines up with Dialogue System Triggers and actively-running instances of conversations, please see Character GameObject Assignments.
Post Reply