Page 2 of 2

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

Posted: Fri Dec 04, 2020 4:08 am
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.

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

Posted: Fri Dec 04, 2020 8:52 am
by Tony Li
Great! Yes, that's the way to do it.