The canvas disappears after some time

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
jghesquiere
Posts: 10
Joined: Thu Aug 04, 2016 10:58 am

The canvas disappears after some time

Post 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.
Attachments
config2.png
config2.png (176.16 KiB) Viewed 564 times
config.png
config.png (92 KiB) Viewed 564 times
User avatar
Tony Li
Posts: 21050
Joined: Thu Jul 18, 2013 1:27 pm

Re: The canvas disappears after some time

Post 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.
Post Reply