Dialogue system event does not trigger

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
iloveloon
Posts: 10
Joined: Wed Dec 01, 2021 12:49 pm

Dialogue system event does not trigger

Post 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 ?
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue system event does not trigger

Post 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.
iloveloon
Posts: 10
Joined: Wed Dec 01, 2021 12:49 pm

Re: Dialogue system event does not trigger

Post 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.
User avatar
Tony Li
Posts: 22154
Joined: Thu Jul 18, 2013 1:27 pm

Re: Dialogue system event does not trigger

Post by Tony Li »

Happy to help! Glad it's working now.
Post Reply