Portrait Disappearing on Second Conversation

Announcements, support questions, and discussion for the Dialogue System.
eturulja
Posts: 7
Joined: Tue Jan 19, 2021 8:25 am

Portrait Disappearing on Second Conversation

Post by eturulja »

Hey Toni! Loving the asset so far, but ran into the first problem that the documentation couldn't help me with.

The way my game is set up, I am calling

Code: Select all

PixelCrushers.DialogueSystem.DialogueManager.StartConversation("Prologue/Start");
in my code whenever I want to play dialogue. I then wait until

Code: Select all

PixelCrushers.DialogueSystem.DialogueManager.IsConversationActive
is false before I go to the next part of the cut-scene where I'm just moving some characters around, and then running another dialogue the same way.

The problem I am running into is that no matter which conversations I start playing and in whatever order, whenever I play a second dialogue, the actor's portrait will flash briefly, and then disappear. Then when I click continue to finish the dialogue, the character's portrait will flash again before closing the entire dialogue UI (I'm using the VN Template with some small tweaks to add 4 panels). The first conversation always loads the actor's portraits correctly, and will toggle between focusing on the different speakers (making them full color, and fading them into black while not talking).

I've tried making different conversations, switching around my ordering, and the problem persists, always on the second conversation invoked in my game. I'm wondering if there is some kind of "cleanup" I have to do after starting conversations the way I am in code. I get no errors/warnings in my logs, and the debug logs seem normal, but I can post those too if needed. I added an attachment of what the "Portrait Image" GameObject in the VN template looks like when the actor is invisible. Any help is appreciated, thanks!
Attachments
InvisiblePortraitExample.PNG
InvisiblePortraitExample.PNG (43.8 KiB) Viewed 220 times
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Portrait Disappearing on Second Conversation

Post by Tony Li »

Hi,

This sounds like an animation setup issue. Does it happen with any of the prefabs that ship with the Dialogue System, such as the default VN prefab?
eturulja
Posts: 7
Joined: Tue Jan 19, 2021 8:25 am

Re: Portrait Disappearing on Second Conversation

Post by eturulja »

That's the one I have used as a base, but just to double check I tried using just the Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs/Standard UI Prefabs/Templates/VN/VN Template Standard Dialogue UI.prefab with no edits as the "Dialogue UI" in my DialogueManager GameObject and I get the same strange behavior. The second conversation flashes the portrait for ~0.2 seconds and then it disappears.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Portrait Disappearing on Second Conversation

Post by Tony Li »

Hi,

I'll investigate and reply back today.

What versions of Unity and the Dialogue System are you using? Also, does it happen with any other prefab UIs such as the Basic Standard Dialogue UI? The VN prefab has a custom animator, and it may be that something needs to be adjusted in it.
eturulja
Posts: 7
Joined: Tue Jan 19, 2021 8:25 am

Re: Portrait Disappearing on Second Conversation

Post by eturulja »

Unity Version 2019.2.17f1 Personal
Pixel Crushers Dialogue System for Unity Version: 2.2.14

May be important to note that I'm running "StartConversation" in a Coroutine using Unity's "StartCoroutine" method, and passing in a function that runs most of my cut-scene. That cut-scene function is what has the two "StartConversation" calls. I will try out moving them out of the coroutine and seeing if that fixes it as well.

I appreciate the help, thanks!
eturulja
Posts: 7
Joined: Tue Jan 19, 2021 8:25 am

Re: Portrait Disappearing on Second Conversation

Post by eturulja »

Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs/Standard UI Prefabs/Templates/Basic/Basic Standard Dialogue UI.prefab
and
Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs/Standard UI Prefabs/Templates/JRPG/JRPG Template Standard Dialogue UI.prefab

Do not exhibit the same behavior, the portraits load on the second call.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Portrait Disappearing on Second Conversation

Post by Tony Li »

I recently updated the animator for the VN prefab. I'll check it and reply back by the end of the day.
eturulja
Posts: 7
Joined: Tue Jan 19, 2021 8:25 am

Re: Portrait Disappearing on Second Conversation

Post by eturulja »

Sounds good, thanks Tony!
eturulja
Posts: 7
Joined: Tue Jan 19, 2021 8:25 am

Re: Portrait Disappearing on Second Conversation

Post by eturulja »

Did some more digging and wanted to share this before I forget. I think you're right about it being in the animator. On the "Subtitle Panel 0", the "Canvas Group" has its alpha set to 0 on the second conversation even though the "Portrait Animation Controller" went through "Any State"->"Show"->"Focus". On the first run it had it's alpha set to 1.

Just wanted to get this to you in case it is useful. Thanks again!

Edit: Also the "Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs/Art/Animation/Canvas Group Animator/Hide.anim" has a property of "Canvas Group.Alpha 1" while "Assets/Plugins/Pixel Crushers/Dialogue System/Prefabs/Art/Animation/Canvas Group Animator/Show.anim" has ""Canvas Group.Alpha 0", seems like these should be opposite? Though just a guess, changing them didn't change functionality for me.
User avatar
Tony Li
Posts: 22049
Joined: Thu Jul 18, 2013 1:27 pm

Re: Portrait Disappearing on Second Conversation

Post by Tony Li »

Hi,

This patch should fix the animation issue:

DS_VNPortraitAnimFix_2021-01-19.unitypackage

Side note: The Canvas Group Animator's Show.anim animates the Canvas Group's Alpha from 0 to 1. If you're looking at Show.anim in the Animation window, you're probably seeing the first frame, where it starts at 0. In subsequent frames, the animation will increase Alpha to 1. (And, for Hide.anim, from 1 down to 0.)
Post Reply