Setting info.Name makes the Dialogue System to not find the actual actor in the scene

Announcements, support questions, and discussion for the Dialogue System.
fkkcloud
Posts: 298
Joined: Mon Oct 05, 2020 6:00 am

Re: Setting info.Name makes the Dialogue System to not find the actual actor in the scene

Post by fkkcloud »

Okay, I was able to kinda fix it.
it was my component who was taking control of the portrait render since I am using RenderTexture to render 3D to place it there..

Code: Select all

   
   
   // dialogueActor is DialogueActor component.
   
   private void Update() {

        if (dialogueActor)
        {
            if (DialogueManager.isConversationActive && DialogueManager.currentConversationState.subtitle.speakerInfo.isNPC)
            {
                if (DialogueManager.currentConversationState.subtitle.speakerInfo.Name== dialogueActor.actor)
                {
                    if (cam1P) cam1P.SetActive(true);
                }
                else
                {
                    if (cam1P && cam1P.activeSelf) cam1P.SetActive(false);
                }
            }
        }
    }
I guess the problem is DialogutActor.actor name is still Jenny but DialogueManager.currentConversationState.subtitle.speakerInfo.Name is a pretty looking girl..

Is there any other information so I can check the current speaker is the actual actor name, and not the Display Name?


Edit:
Using

Code: Select all

DialogueManager.currentConversationState.subtitle.speakerInfo.nameInDatabase
instead of

Code: Select all

DialogueManager.currentConversationState.subtitle.speakerInfo.Name
matches with DialogueActor.actor and works good for me.
User avatar
Tony Li
Posts: 22051
Joined: Thu Jul 18, 2013 1:27 pm

Re: Setting info.Name makes the Dialogue System to not find the actual actor in the scene

Post by Tony Li »

Great! Yes, that's the way to do it.
Post Reply