[SOLVED] UI Button in Selector Elements UI Not Working

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Luseya
Posts: 38
Joined: Mon May 29, 2023 6:02 pm

[SOLVED] UI Button in Selector Elements UI Not Working

Post by Luseya »

Hello!

I customized the UI Selector Elements so that a small menu appears when the Player approaches an NPC. They have different interact options (have a casual chat, apologize for something, etc.)

I added these buttons to the Main Selector Panel and added the Dialogue System Trigger component to the UI buttons, then called DialogueSystemTrigger.OnUse in the buttons' OnClick() event so that when they click a button, it will start a specific conversation. However, when I play the game and click the button, nothing happens. Am I missing a component or setting somewhere?

Image

I have the Player's Proximity Selector set up with E as the Use Key because I want them to still be able to press E to trigger the default conversation with the NPC.

Image

Any insight would be appreciated. Thank you!
Last edited by Luseya on Thu May 22, 2025 7:51 pm, edited 1 time in total.
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI Button in Selector Elements UI Not Working

Post by Tony Li »

Hi,

Do any errors or warnings appear in the Console window?

If not, then temporarily set the Dialogue Manager's Other Settings > Debug Level to Info and reproduce the issue. Do you see a line like the one below?

Dialogue System: Starting conversation 'Apologies' with actor=X and conversant=Y
Luseya
Posts: 38
Joined: Mon May 29, 2023 6:02 pm

Re: UI Button in Selector Elements UI Not Working

Post by Luseya »

Hi Tony,

I don't see any errors or warnings in the Console window, and after ticking on the Debug setting, nothing shows up in the Console window when I click the UI button. Seems like it's just not working at all :/
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI Button in Selector Elements UI Not Working

Post by Tony Li »

Does the Dialogue System Trigger's Conditions section show "(Last Check: True)" or "(Last Check: False)"?

In the Console, do you see "Dialogue System: Dialogue System Trigger is firing OnUse"? If not, then your button/code isn't calling the Dialogue System Trigger's OnUse() method, or the Conditions are currently false (in which case you'll see Last Check: False).
Luseya
Posts: 38
Joined: Mon May 29, 2023 6:02 pm

Re: UI Button in Selector Elements UI Not Working

Post by Luseya »

Hi Tony,

The Dialogue System Trigger's Conditions section shows "(Last Check: None)" which should be correct since there are no specific conditions to trigger this conversation.

In the Console, I don't see "Dialogue System: Dialogue System Trigger is firing OnUse" - That's the part I don't understand, why it wouldn't be calling the OnUse() method, even though I clearly have it in the OnClick() event :/
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: UI Button in Selector Elements UI Not Working

Post by Tony Li »

If it shows (Last Check: None), this means it hasn't even tried to run OnUse(). If there are no conditions, when you call OnUse() it will show (Last Check: True). Double check that your button's OnClick() is calling OnUse() on the Dialogue System Trigger that you intend.
Luseya
Posts: 38
Joined: Mon May 29, 2023 6:02 pm

Re: UI Button in Selector Elements UI Not Working

Post by Luseya »

Hi Tony,

This is so embarrassing, but I realized the cause of the issue was that I had a button component on both the button AND on the text inside it. I have no idea how I managed to do that :roll:

Anyway, it is working now as expected. Thank you for your help! Your explanation of (Last Check: None) helped me to realize it was an issue with the button itself and not an issue with the Dialogue System setup.

I appreciate you going through this with me!
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: [SOLVED] UI Button in Selector Elements UI Not Working

Post by Tony Li »

Glad I could help!
Post Reply