Page 1 of 1

How to get currently speaking actor through code?

Posted: Sun Nov 29, 2020 8:58 pm
by EntertainmentForge
I stumbled trying to get info about the current actor who is talking. I tried several things but I always get the actor that started the conversation. Never the currently speaking actor.

I tried few things but it always get's me Player or Actor who started conversation. Not the currently speaking one.

Code: Select all

dialogueSystemController.conversationController.actorInfo.Name
dialogueSystemController.CurrentActor.name
DialogueManager.conversationModel.actorInfo.Name
Pretty much all I need is the name of the actor. I am guessing these is some function that serves this purpose but I'm missing it.

P.S. Great asset!

Re: How to get currently speaking actor through code?

Posted: Sun Nov 29, 2020 9:43 pm
by Tony Li
Hi,

DialogueManager.currentConversationState contains all the info about the current state of the conversation.

Code: Select all

string currentActorName = DialogueManager.currentConversationState.subtitle.speakerInfo.Name;

Re: How to get currently speaking actor through code?

Posted: Mon Nov 30, 2020 2:26 pm
by EntertainmentForge
That's exactly what I needed. Thanks!

Re: How to get currently speaking actor through code?

Posted: Mon Nov 30, 2020 2:48 pm
by Tony Li
Glad to help!