NPC Panel Doesn't Hide Immediately

Announcements, support questions, and discussion for the Dialogue System.
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

NPC Panel Doesn't Hide Immediately

Post by airwick »

I have a simple NPC and Player convo. The NPC starts talking and when continuing the PC panel comes in but the NPC panel stays on screen for several seconds before it is turned off without playing the hide animation (this happens when not hitting continue on the PC dialogue). I have failed to find any more info regarding this issue and can not find additional info/options regarding the NPC panel being turned off when the PC comes up. I would like only one panel to show on screen at a time.

Any help would be appreciated.
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

I'm using the TextMeshPro Dialogue UI
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: NPC Panel Doesn't Hide Immediately

Post by Tony Li »

Hi,

I'm looking into this now. What versions of Unity and the Dialogue System are you using?

Is the conversation designed to play without player interaction? That is, it shows the NPC subtitle, PC subtitle, NPC subtitle, etc., without a player response menu? Or does it also incorporate a response menu?
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

v 1.6.6.5
Unity 5.4.1p1

The dialogue does include a response menu, I tried a conversation without a response menu and the same issue happens.
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: NPC Panel Doesn't Hide Immediately

Post by Tony Li »

Here's an example scene that uses a simple TextMesh Pro dialogue UI:

TMPro_Example_2016-10-28-2.unitypackage [edit: Updated package]

It runs the conversation without showing a response menu, but requiring the player to click the Continue button to progress past each line.
  • To disable the Continue button, inspect the Dialogue Manager and set Subtitle Settings > Continue Button to Never.
  • To show a response menu, inspect the Dialogue Manager and tick Input Settings > Always Force Response Menu.
If you can't get your dialogue UI to work like this (or however you want it to work), please feel free to send an example project to tony (at) pixelcrushers.com. I'll be very happy to take a look.
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

Adding an animation component to the panel and setting the show and hide triggers seems to be the problem. The animation scales in the rect transform of the panel.
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: NPC Panel Doesn't Hide Immediately

Post by Tony Li »

Sorry, that part slipped my mind. I'll check that out now and post back here soon.
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: NPC Panel Doesn't Hide Immediately

Post by Tony Li »

Here's an updated example scene with animation. There was indeed an issue with subtitle panel animation that's been fixed in the code for the next release. I included the fixed script (UIShowHideController.cs) in the package below:

TMPro_Example_2016-10-28-2.unitypackage

The Dialogue System Extras page also has an updated TextMesh Pro Support package. It's not mandatory. It just gets rid of an "OnLevelWasLoaded" API deprecation warning in the Console window.

When you set up your dialogue UI, before building for production you'll want to set your panels to their "hidden" state. In the example scene, this means the Canvas Group alpha is 0 and the GameObject is inactive. This avoids a one-frame blink and/or extra hide animation at start.
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

Thanks for the help!

Something I overlooked that might help someone else was that I was using the Animation Names for the Show Trigger and Hide Trigger values instead of the trigger parameter names like exampled in Canvas Group Animator Controller.
User avatar
Tony Li
Posts: 23260
Joined: Thu Jul 18, 2013 1:27 pm

Re: NPC Panel Doesn't Hide Immediately

Post by Tony Li »

Happy to help!
Post Reply