Page 1 of 1

How to use dialogue system for generated npc

Posted: Sun Feb 04, 2024 9:38 pm
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!

Re: How to use dialogue system for generated npc

Posted: Mon Feb 05, 2024 8:42 am
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