UI Toolkit PC/NPC panel mixup ?

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
NotVeryProfessional
Posts: 159
Joined: Mon Nov 23, 2020 6:35 am

UI Toolkit PC/NPC panel mixup ?

Post by NotVeryProfessional »

I'm setting up Dialogue System with UITK for the first time (always used UGUI previously). It seems to me that it's using the NPC panel also for PC subtitles. I'm using the provided default setup and only added my own styling and changed it from a vertical to a horizontal layout. Here's how it's set up:
Bildschirmfoto 2025-05-28 um 07.45.27.png
Bildschirmfoto 2025-05-28 um 07.45.27.png (942.96 KiB) Viewed 2176 times
And here is how it shows up at runtime:
Bildschirmfoto 2025-05-28 um 07.45.08.png
Bildschirmfoto 2025-05-28 um 07.45.08.png (591.97 KiB) Viewed 2176 times
I've double-checked that the player actor (display name "You") has the "isPlayer" checkbox and that the panel assignments in UIToolkitDialogueUI are correct.

The NPC subtitles also show up on the right, and there is never any subtitles in the left box.
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI Toolkit PC/NPC panel mixup ?

Post by Tony Li »

Hi,

Make sure you've set the panel indices:

panelIndices.png
panelIndices.png (52.24 KiB) Viewed 2171 times
NotVeryProfessional
Posts: 159
Joined: Mon Nov 23, 2020 6:35 am

Re: UI Toolkit PC/NPC panel mixup ?

Post by NotVeryProfessional »

yes, I've done that as well.
Bildschirmfoto 2025-05-28 um 16.38.36.png
Bildschirmfoto 2025-05-28 um 16.38.36.png (369.92 KiB) Viewed 2169 times
NotVeryProfessional
Posts: 159
Joined: Mon Nov 23, 2020 6:35 am

Re: UI Toolkit PC/NPC panel mixup ?

Post by NotVeryProfessional »

and the UXML should also be fine. As I said: I changed nothing except styling and changing it to horizontal instead of vertical:
Bildschirmfoto 2025-05-28 um 16.40.16.png
Bildschirmfoto 2025-05-28 um 16.40.16.png (45.49 KiB) Viewed 2169 times

I'll hopefully have some time for debugging in the next days. Let's see what's causing this.
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI Toolkit PC/NPC panel mixup ?

Post by Tony Li »

Hi,

I confirmed that the basic UI Toolkit dialogue UI uses the correct subtitle panels. As a test, you can assign it to the Dialogue Manager and change the NPC subtitle panel's background to a different color. You should see that NPC lines use the different-colored subtitle panel but player lines don't.

If that doesn't help and debugging doesn't turn up anything, please feel free to send a reproduction project to tony (at) pixelcrushers.com
NotVeryProfessional
Posts: 159
Joined: Mon Nov 23, 2020 6:35 am

Re: UI Toolkit PC/NPC panel mixup ?

Post by NotVeryProfessional »

Something is off with my setup then. I've assigned the UI document that comes with Dialogue System and I get this:
Bildschirmfoto 2025-06-02 um 18.40.15.png
Bildschirmfoto 2025-06-02 um 18.40.15.png (137.18 KiB) Viewed 76 times
Which doesn't look right. "You" has taken over both the PC and NPC subtitles.

(there's some USS styling that gets applied, but the UI Document is unchanged, didn't even change the background color)

I'll go digging and let you know what I find. Maybe there's something in my findings that will help others as well. Thanks for your time, the support here is simply amazing for an asset that is very affordable.
NotVeryProfessional
Posts: 159
Joined: Mon Nov 23, 2020 6:35 am

Re: UI Toolkit PC/NPC panel mixup ?

Post by NotVeryProfessional »

So I added a bit of debug output here in UIToolkitDialogueUI:
Bildschirmfoto 2025-06-02 um 18.59.12.png
Bildschirmfoto 2025-06-02 um 18.59.12.png (223.42 KiB) Viewed 66 times


and this is the result:
Bildschirmfoto 2025-06-02 um 18.59.23.png
Bildschirmfoto 2025-06-02 um 18.59.23.png (102.46 KiB) Viewed 66 times
It does mix up the panel assignments somewhere. I've double-checked again and my setup is unchanged from above.

I ended up in UIToolkitDialogueElements and am not sure if line 42 is intentional:

Code: Select all

        public override AbstractUISubtitleControls pcSubtitleControls => NPCSubtitleElements;

I changed it to

Code: Select all

        public override AbstractUISubtitleControls pcSubtitleControls => PCSubtitleElements;
And that appears to solve the issue.
User avatar
Tony Li
Posts: 23238
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI Toolkit PC/NPC panel mixup ?

Post by Tony Li »

Thank you! That's definitely a typo and a bug. I'll fix that in the upcoming version 2.2.53.3.
Post Reply