Search Unity

Bug Cannot detect when a UI button is pressed using visual scripting

Discussion in 'Visual Scripting' started by dusthound, Oct 21, 2023.

  1. dusthound

    dusthound

    Joined:
    Sep 18, 2018
    Posts:
    98
    Hi there,

    I am working on implementing pause menu for a project I am working on and I am having trouble adding functionality to the buttons in the menu. I initially tried to detect when the button is pressed by the mouse using the OnButtonClick method, but this method node, and the code that immediately follows it are not being run.

    I have a screenshot of my script graph attached below, and a screenshot of the button component settings in the inspector. Let me know if I can provide any additional information, thank you in advance for your assistance.


     
  2. bugfinders

    bugfinders

    Joined:
    Jul 5, 2018
    Posts:
    1,781
    did you add the visual script to this button?