possible (minor) animation fade-in bug?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Arcanor
Posts: 81
Joined: Sun Oct 05, 2014 4:20 am

possible (minor) animation fade-in bug?

Post by Arcanor »

I'm noticing when using either the "Slide Right Canvas Group Animator Controller" or the "Canvas Group Animator Controller" that there's a single-frame "flash" of the empty dialogue window before the Canvas Group's alpha is reset by the animation from 1 to 0, and then starts fading back up to 1 again.

I've already set the Canvas Group to 0 Alpha before the scene begins. However, as soon as the first conversation starts it is set to 1 and never resets back to 0 (unless animated temporarily).

I think the dialogue manager is setting this to 1 during the first conversation, but forgetting to reset it back to its original value after the conversation ends.

Maybe I can work around this issue by resetting the Canvas Group alpha back to 0 in my HideSubtitle() override?
Arcanoria Games - http://www.arcanoria.com - indie game development blog
twitter: https://twitter.com/WaltCollins3 @WaltCollins3
Game titles: Pesticide Patrol, Arcanoria Chronicles, CyberGhost, Arcanoria
PLAY NOW: http://arcanor.itch.io/
Arcanor
Posts: 81
Joined: Sun Oct 05, 2014 4:20 am

Re: possible (minor) animation fade-in bug?

Post by Arcanor »

I've added the following line of code to both my ShowSubtitle() and HideSubtitle() overrides:

Code: Select all

dialogue.panel.gameObject.GetComponent<CanvasGroup>().alpha = 0;
The fade-in is now working properly, without the "one frame flashing" that I mentioned earlier.
Arcanoria Games - http://www.arcanoria.com - indie game development blog
twitter: https://twitter.com/WaltCollins3 @WaltCollins3
Game titles: Pesticide Patrol, Arcanoria Chronicles, CyberGhost, Arcanoria
PLAY NOW: http://arcanor.itch.io/
User avatar
Tony Li
Posts: 21676
Joined: Thu Jul 18, 2013 1:27 pm

Re: possible (minor) animation fade-in bug?

Post by Tony Li »

That's the way to do it. The Dialogue System doesn't get control of UI elements until after the first frame, at which point they've already been visible for one frame.

BTW, there's an updated Unity UI support package on the customer download page. It includes some minor improvements to the way animations are handled as well as a "Queue Alerts" checkbox.
Arcanor
Posts: 81
Joined: Sun Oct 05, 2014 4:20 am

Re: possible (minor) animation fade-in bug?

Post by Arcanor »

Thanks Tony, I will download that update now so I can have the latest animation refinements.
Arcanoria Games - http://www.arcanoria.com - indie game development blog
twitter: https://twitter.com/WaltCollins3 @WaltCollins3
Game titles: Pesticide Patrol, Arcanoria Chronicles, CyberGhost, Arcanoria
PLAY NOW: http://arcanor.itch.io/
Post Reply