SpeakerInfo portrait null for some team members
Posted: Wed Oct 04, 2023 5:53 pm
I'm using the dialogueEvents in C# to do some custom portrait animation when lines are delivered using:
Which works perfectly on my computer, the problem is that on some of the team member's computers they speakerInfo.portrait is null when this event is called.
I figure it has something to do with async loading (we use large detailed portrait sprites).
We managed prevent this issue by calling:
In the sequence of the start node for every conversation, but that's going to be a huge problem if we start adding more NPC portraits, we have need to go through all dialogue again to add these.
(The reason we use SetPortrait is that NPC have different expression portraits we need to change for each line. which works great!)
Is there another solution for this problem?
Thanks in advance for your time!
Code: Select all
dialogueEvents.conversationEvents.onConversationLine.AddListener(LineDelivered);
Code: Select all
public void LineDelivered(Subtitle subtitle)
{
if (subtitle.speakerInfo.portrait != null)
{
}
}
I figure it has something to do with async loading (we use large detailed portrait sprites).
We managed prevent this issue by calling:
Code: Select all
{{default}};
SetPortrait(FirstNPC, pic=1);
SetPortrait(SecondNPC, pic=1);
(The reason we use SetPortrait is that NPC have different expression portraits we need to change for each line. which works great!)
Is there another solution for this problem?
Thanks in advance for your time!