This is a niche issue, but there's one instance in my game where I need to change the actor's display name temporarily. I asked about this previously and I think downloaded a little extra for it. I use a lua command called "ChangeActorName."
if (DialogueDebug.LogInfo) Debug.Log("Dialogue System: Changing " + actorName + "'s Display Name to " + newDisplayName);
DialogueLua.SetActorField(actorName, "Display Name", newDisplayName);
if (DialogueManager.IsConversationActive)
{
var actor = DialogueManager.MasterDatabase.GetActor(actorName);
if (actor != null)
{
var info = DialogueManager.ConversationModel.GetCharacterInfo(actor.id);
if (info != null) info.Name = newDisplayName;
}
}
When I do this, the actor's portrait no longer shows up and an error is thrown saying animator is inactive.
Here's an example that you can compare. I exported it from Unity 2019.3. It combines the "Discover Name Example" scene with the "Animated Portrait Example" scene. The character whose names changes also changes panels, but I tested it without changing panels and that works, too.
Shoot, I apologize! I just tested the example you gave and it worked fine. I just realized the DialogueActor's game object was inactive when the conversation started in my game. I use SetActive() so I didn't notice, but if the game object isn't active when the conversation begins, and I don't set a default portrait (I think that's possible) then I run into the issue.
I just activated the object and it worked fine. Sorry for taking up your time!