How do I hide a text panel if nothing's been said yet?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

How do I hide a text panel if nothing's been said yet?

Post by AoF »

Whenever you click on a character in my game, it pops up a dialogue choice. Because of this, the dialogue window doesn't have any text yet and I think it looks kind of weird that it's blank:



How do I hide it in this situation? I'm sure SetActive could be used for this, but I'm wondering if there's a setting that's a more natural way to deal with this? Also, I've experienced things breaking unless you SetActive on the exact right GameObject, so if that's the right way to go about it, which GameObject should I set it to false on?

Here's my hierarchy:

User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do I hide a text panel if nothing's been said yet?

Post by Tony Li »

It looks like you just need to change the PC Subtitle Panel's Visibility dropdown to any value other than Always From Start.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: How do I hide a text panel if nothing's been said yet?

Post by AoF »

That didn't seem to work for me:



I tried another setting and it still showed up.

It might help to see my conversation:



All characters share the same subtitle panel. Perhaps that Hub counts as Kira saying something and makes it show up? That hub is blank though. And now that I think about it, it doesn't make sense to me that it says Player below when they have not been involved in the conversation yet. But, that may be an unrelated point.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: How do I hide a text panel if nothing's been said yet?

Post by AoF »

I see now that it kind of worked, but the Text Panel is still showing its image. Is there a way to prevent that? Why does it work that way?
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do I hide a text panel if nothing's been said yet?

Post by Tony Li »

It's because the "Text Panel" GameObject isn't controlled by anything, so nothing hides it. It's active whenever the Dialogue Panel is active.

Since you're revamping your UI, you might want to move/merge it into Subtitle Panel 1. The Basic Standard Dialogue UI prefab might provide a good example structure for your UI.
AoF
Posts: 241
Joined: Sun May 12, 2019 8:36 pm

Re: How do I hide a text panel if nothing's been said yet?

Post by AoF »

Cool, I did that and it fixed the problem. Thanks!
User avatar
Tony Li
Posts: 21721
Joined: Thu Jul 18, 2013 1:27 pm

Re: How do I hide a text panel if nothing's been said yet?

Post by Tony Li »

Great! Glad to help.
Post Reply