Working in 2D, I have an NPC with a dialogue system trigger set to On Use, and performs Start Conversation. I have set the Actor to the player, and the Conversant to this NPC.
I also added another two dialogue system triggers for OnConversationStart and OnConversationEnd to this same NPC gameobject, and im executing a UnityEvent (calling a function in a script) on these, but its never actually firing. The conversation starts fine, just trying to get these events to trigger specifically on start and end as well.
I viewed the debug info for DialogueManager, and the actor and conversant are properly set to Player and my NPC.
The only way I can get it to trigger is if I switch the NPC to the Conversation Actor spot, and move the Player to the Conversant spot. But that causes the conversation to enter an infinite loop when I press the submit/continue button on the last conversation node - it just restarts as soon as I press it.
Screenshot attached.
Dialogue System Trigger - OnConversationStart/End
-
- Posts: 12
- Joined: Tue Feb 22, 2022 11:23 am
Dialogue System Trigger - OnConversationStart/End
- Attachments
-
- inspector.png (151.13 KiB) Viewed 256 times
Re: Dialogue System Trigger - OnConversationStart/End
Hi,
Check your conversation in the Dialogue Editor. Is the conversation's Actor dropdown set to Player and Conversant dropdown set to Nurse? (This will help it match with your assignments on the OnUse Dialogue System Trigger.)
Also, you may find it simpler to replace the OnConversationStart & OnConversationEnd Dialogue System Triggers with a single Dialogue System Events component. It has OnConversationStart() and OnConversationEnd() UnityEvents.
Check your conversation in the Dialogue Editor. Is the conversation's Actor dropdown set to Player and Conversant dropdown set to Nurse? (This will help it match with your assignments on the OnUse Dialogue System Trigger.)
Also, you may find it simpler to replace the OnConversationStart & OnConversationEnd Dialogue System Triggers with a single Dialogue System Events component. It has OnConversationStart() and OnConversationEnd() UnityEvents.
-
- Posts: 12
- Joined: Tue Feb 22, 2022 11:23 am
Re: Dialogue System Trigger - OnConversationStart/End
Setting the conversant to "Nurse" (name of the game object) in the dialogue editor fixed the issue!
Weird, because on a previous project in Unity 2020 (now in 2021), it worked even though I kept all the NPCs labeled as "NPC" in the dropdown for simplicity. That's how I had it setup here previously.
Thanks for the help!
Weird, because on a previous project in Unity 2020 (now in 2021), it worked even though I kept all the NPCs labeled as "NPC" in the dropdown for simplicity. That's how I had it setup here previously.
Thanks for the help!
Re: Dialogue System Trigger - OnConversationStart/End
If you want to get to the bottom of it, this page will probably explain what was going on:
Character GameObject Assignments
(OnConversationStart and OnConversationEnd are only invoked on the GameObjects that are being used as the conversation's actor and conversant.)
Character GameObject Assignments
(OnConversationStart and OnConversationEnd are only invoked on the GameObjects that are being used as the conversation's actor and conversant.)