Page 1 of 4

Portrait Flashing on Conversation Start

Posted: Sun Jun 05, 2022 4:31 am
by NicoMozes
Hi There!
I was hoping you could offer assistance with a small flashing of portrait im having when starting a conversation.
I am tweaking the Dialogue/Quest system, and whenever starting the conversation, the wrong actor portrait keeps flashing when starting.

I have tried switching the actors around, the Actor/Conversant roles, but I cannot figure it out. I also looked on previous post but did not see any sollution that I could apply.

I have attached a GIF that hopefully shows the issue.
Thanks in advance,
Nico

Re: Portrait Flashing on Conversation Start

Posted: Sun Jun 05, 2022 8:15 am
by Tony Li
Hi,

Make sure the actor with the correct portrait is assigned as the conversation's Actor or Conversant. (Set the Conversant if it's an NPC.) Then check that the <START> node is set to the conversation's Actor or Conversant.

Re: Portrait Flashing on Conversation Start

Posted: Sun Jun 05, 2022 1:32 pm
by NicoMozes
Hi Toni,

Thanks for the reply! I have double checked and I think that part is correct. I compared the demo scenes, but im using a different UI. Is there a chance it could be the UI prefab?

Re: Portrait Flashing on Conversation Start

Posted: Sun Jun 05, 2022 1:33 pm
by Tony Li
Hi,

Try assigning Mika to the <START> node's Actor dropdown. If your subtitle panel's Visibility is set to Always From Start and your UI uses the same panel for PCs and NPCs, it may be setting the panel to the player's portrait when the UI opens, and then changing it to Mika when the conversation gets to the "Hurry up!" node.

Re: Portrait Flashing on Conversation Start

Posted: Sun Jun 05, 2022 6:08 pm
by NicoMozes
Hi Toni,

Thanks for the assistance but I could not make it work. I will just swap UI for now and relook at this in the future.

On a separate note, if I wanted to have a conversation between two NPCs, what settings do I need for the portraits to show on different subtitle panel?

I currently have such conversation, but both characters are using the same Subtitle Panel 0.

Thanks in advance,
Nico

Re: Portrait Flashing on Conversation Start

Posted: Sun Jun 05, 2022 6:58 pm
by Tony Li
Hi Nico,

Each subtitle panel should be assigned to the dialogue UI's Standard Dialogue UI component > Conversation UI Elements > Subtitle Panels list. Each panel will have a number in the list (0, 1, 2, etc.).

Add a Dialogue Actor component to each NPC's GameObject. If the NPC doesn't have a GameObject, you can create an empty GameObject. Set the Actor dropdown. Then set Dialogue UI Settings > Subtitle Panel Number to the panel number you want the NPC to appear in.

Re: Portrait Flashing on Conversation Start

Posted: Mon Jun 06, 2022 4:41 am
by NicoMozes
Amazing!
Thank you so much and congratulations for some of the best assets for Unity!

Keep up the good work!

Re: Portrait Flashing on Conversation Start

Posted: Mon Jun 06, 2022 7:48 am
by Tony Li
Thanks! Glad to help. :-)

Re: Portrait Flashing on Conversation Start

Posted: Mon Dec 18, 2023 7:20 pm
by lcn_mc
Apologies for resurrecting this old thread, but I'm running into exactly the same issue as described by the original poster in the first post.

I've checked the usual suspects (actors being correctly set and such when the panels are called), and after some experimentation, I've narrowed down the issue to the following:
  • I have all of the Subtitle Panels (where the portraits are displayed) on top of each other as part of my UI design, with the idea being that whoever is talking has their portrait displaying on screen, while if you're not talking, your portrait isn't show.
  • If there is a conversation where the player does not say the first line, the player's Subtitle Panel ('Subtitle Panel 1', which is set as the Default PC Subtitle Panel in the VN Template Dialogue Standard UI object I'm using) will still flash briefly at the start of the conversation for about a quarter of a second before the first line in the conversation occurs.
  • By watching the Hierarchy and stepping through the scene in play mode frame-by-frame, I can observe that Subtitle Panel 0, set as the Default NPC Subtitle Panel in the VN Template Dialogue Standard UI object, is sent to the top of the Hierarchy under the Subtitle Panels parent game object at the start of the conversation with Subtitle Panel 1 in front of it, even though the first line in the conversation is spoken by a NPC. Since Subtitle Panel 1 is lower in the hierarchy than Subtitle Panel 0, even for that quarter-second, it's still rendered on top, which is causing this issue.
Is there a way to ensure that the Subtitle Panel assigned to the speaker of the first line in a conversation is always moved to the bottom of the Subtitle Panel's child hierarchy so it is guaranteed to appear first?

Thanks for the help, as always.

Re: Portrait Flashing on Conversation Start

Posted: Mon Dec 18, 2023 8:05 pm
by Tony Li
Hi,

The Standard Dialogue UI scripts won't move GameObjects in the dialogue UI's hierarchy. However, if the player subtitle panel's Visibility is set to Always From Start, it may flash before another subtitle panel takes focus. To avoid this, set its Visibility to Always Once Shown.