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

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

The issue seems to be with this new line of code in TextMeshProSubtitleControls:ShowPanel

Code: Select all

			// If active, disable & reenable to trigger typewriter:
			if (line.gameObject.activeInHierarchy)
			{
				line.gameObject.SetActive(false);
				line.gameObject.SetActive(true);
			}
The fix seems to be:

Code: Select all

			if (line != null && line.gameObject.activeInHierarchy)
			{
				line.gameObject.SetActive(false);
				line.gameObject.SetActive(true);
			}
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,

Thank you. Is the fix still working for you? I'll incorporate it into the source.
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

Yes it's working now with no errors, thanks.
airwick
Posts: 16
Joined: Fri Oct 28, 2016 12:43 pm

Re: NPC Panel Doesn't Hide Immediately

Post by airwick »

I'm finding an issue turning off the line object and turning it back on to trigger the type writer effect.

The UnityEvent calls to OnEnd are called twice, so it's calling it early when it's turned off and again when the type writer effect actually finishes. I use this to stop the character speaking animation.
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 »

This updated package has a more graceful solution. Instead of turning the line object off and back on, it adds an OnReshowPanel event to the TextMeshProDialogueUI's subtitle panel sections. You can use this event to call the typewriter effect's Rewind method, which is a cleaner way to make sure the typewriter runs properly.

TextMeshPro_Support_2016-12-19.unitypackage
Post Reply