Page 1 of 1

The canvas disappears after some time

Posted: Mon Sep 12, 2016 11:02 am
by jghesquiere
Hello,

When I start a conversation, sometimes the canvas disappears.
I can't start another conversation.
There is nothing special in the console.

I try to change lot of things but nothing works.

Thank you

Edit : Another question, how does "Show" and "Hide" triggers works ? Because it looks like they are randomly fired in my project.

Re: The canvas disappears after some time

Posted: Mon Sep 12, 2016 2:06 pm
by Tony Li
What UI elements do you expect to appear, and which are visible / not visible?

When the scene starts, the dialogue UI will play the Dialogue Panel's Hide animation to make sure it's not visible, and then it will deactivate the Dialogue Panel.

When a conversation starts, the dialogue UI will activate the Dialogue Panel and play its Show animation.

When a character says a line, the dialogue UI will activate the appropriate subtitle panel (e.g., NPC Subtitle Panel) and play its Show animation.

A good way to start debugging is to:

1. Inspect the dialogue UI.

2. Find the Dialogue Panel's Animation Transitions. These are just below the "On Content Changed ()" event block, near the bottom. Temporarily clear the Show Trigger and Hide Trigger fields. Your screenshot shows that you've already done this. The dialogue UI will just activate and deactivate the Dialogue Panel at the right time, without playing animations.

3. Then look at the NPC Subtitle section. Temporarily clear its Animation Transitions > Show Trigger and Hide Trigger, too. The dialogue UI will just activate and deactivate the NPC Subtitle when an NPC delivers a line, without playing animations.

Then play the scene. Does the conversation work now? This will help you determine if the animations cause the problem or if it's something else.

If the conversation still doesn't work, expand the dialogue UI in the Hierarchy view, and play the scene again. Watch the dialogue UI's child GameObjects activate and deactivate. If the dialogue UI doesn't activate the correct GameObjects, please let me know which ones. You can compare this to an example scene such as Examples > Unity UI Examples > Generic Unity UI Example Scene.

If the conversation works without animation, try adding the Show and Hide Triggers again. If you pause the game during conversations, make sure your Animators are set to Unscaled Time so they can play while paused.

Please also feel free to send an example scene to tony (at) pixelcrushers.com. I'll be happy to take a look.