How to use dialogue system for generated npc

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
JJChicken
Posts: 1
Joined: Sun Feb 04, 2024 9:30 pm

How to use dialogue system for generated npc

Post by JJChicken »

Hello,

I am developing a open world game which generated npcs when game is started.
I currenty created multiple template conversions, but i didn't know how to set conversation actor in runtime.
Could you help me?

Thank you very much!
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: How to use dialogue system for generated npc

Post by Tony Li »

Hi,

In C#, you can pass the generated NPC's transform to DialogueManager.StartConversation():

Code: Select all

DialogueManager.StartConversation("conversation title", playerTransform, generatedNPCTransform);
If you're using a Dialogue System Trigger, assign the NPC's transform to conversationConversant:

Code: Select all

GetComponent<DialogueSystemTrigger>().conversationConversant = generatedNPCTransform;
For other ways, please see: Character GameObject Assignments
Post Reply