Page 1 of 1

Dialogue system event does not trigger

Posted: Fri Dec 03, 2021 4:56 am
by iloveloon
Hi, move my question from discord to here because I feel like I'll bother everyone by noob question. Information as follows :

1.My npc has Dialogue system trigger and Usable components

Image

2.My player has Dialogue system events and Selector components

Image

3.My player can interact with npc just fine with above setups.

Image

4.I initiated my player on runtime so I dragging my player prefab from project to inspector.

Image

5.This is log when conversation start (which I assumed correct)

Dialogue System: Starting conversation 'New Conversation 1', actor=MyPlayer (UnityEngine.Transform), conversant=MyGuide (UnityEngine.Transform).
UnityEngine.Debug:Log(Object, Object)

6.I use Top down engine with default setting

The problem is I can't trigger event on dialogue system event (in this case is SetActive to false)

But I have another working event system that I've setup the same way by dragging my player prefab from project to inspector.

What should I do ?

Re: Dialogue system event does not trigger

Posted: Fri Dec 03, 2021 8:17 am
by Tony Li
Hi,

Why are you deactivating the player when a conversation starts that involves the player?

Also, make sure not to assign prefabs to inspector fields unless the inspector field is on the same prefab itself. For example, if you're editing a prefab, you can assign the prefab itself to its own Dialogue System Events > OnConversationStart() method.

However, if you have a Dialogue System Trigger in the scene, you should not assign the player prefab to its Actions > Start Conversation > Conversation Actor field. This is because, at runtime, the player instance will be the actor, not the player prefab.

Re: Dialogue system event does not trigger

Posted: Fri Dec 03, 2021 12:22 pm
by iloveloon
Thank you !! I just remove my player prefab from Actions > Start Conversation > Conversation Actor field. and it works !!

I just use deactivate as a simple test because it's obvious to see if the event trigger or not.

Re: Dialogue system event does not trigger

Posted: Fri Dec 03, 2021 12:24 pm
by Tony Li
Happy to help! Glad it's working now.