OnConversationStart / End not firing by default

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
danieltorok
Posts: 11
Joined: Tue Nov 28, 2023 9:36 am

OnConversationStart / End not firing by default

Post by danieltorok »

Hello! I have set up a gameObject with a Dialogue System Trigger and MyScript components. I implemented OnConversationStart and End methods in MyScript. As far as I know, these events are called on the Actor and Conversant objects assigned in the Dialogue System Trigger component. The tooltip for these fields says that if "None" is assigned, then "this" gameObject, or the one that "triggered the conversation" will be used. However, If I leave both of these field on "None", the methods in MyScript are not getting called.

I'm wondering if it is a bug or I misunderstood something.
User avatar
Tony Li
Posts: 20778
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationStart / End not firing by default

Post by Tony Li »

Hi,

Sorry for the confusion. I'll try to clarify:

OnConversationStart(Transform) and OnConversationEnd(Transform) methods will only be called on the GameObjects being used as the active conversation's conversation actor and conversation conversant. Note that the methods must accept a Transform, such as:

Code: Select all

void OnConversationStart(Transform actor) {...}
You can assign GameObjects to the Dialogue System Trigger's Conversation Actor and Conversation Conversant, in which case those GameObjects will be used.

Otherwise it will use GameObjects as determined by these rules: Character GameObject Assignments

To verify which GameObjects are being used, temporarily set the Dialogue Manager's Other Settings > Debug Level to Info. When a conversation starts, you'll see a line in the Console window like:

Dialogue System: Starting conversation 'title' with actor=XXX and conversant=YYY

where XXX and YYY are the GameObjects being used as the actor and conversant.

More info on this:

danieltorok
Posts: 11
Joined: Tue Nov 28, 2023 9:36 am

Re: OnConversationStart / End not firing by default

Post by danieltorok »

Thank you for the quick reply!

The tooltip got me confused as it doesn't mention the rules you linked in the doc.
In my case this rule was taking effect: "It will look for a GameObject that has a Dialogue Actor component whose actor dropdown matches the conversation's conversant." (rather then using "this" gameObject as the tooltip says)

It is working now as expected, thank you!
User avatar
Tony Li
Posts: 20778
Joined: Thu Jul 18, 2013 1:27 pm

Re: OnConversationStart / End not firing by default

Post by Tony Li »

Glad to help!
Post Reply