Can I add events or custom function calls from a script to the default buttons? I am trying to register these events in the “UIButtonInput” class, but when I use the buttons, I don't get any response from the events. I want to do something similar to "onClick.AddListener(DebugTest)" so that when selecting a custom option within a UI Box that I created, the "DebugTest" function is executed.
  • You should be able to subscribe to the actual Unity Button class OnClick.

    For example, you can tie it to an Animation Machine to execute a schematic that calls what you're after.

    image
  • edited November 6
    @Acissathar I already tried adding the event, but when I navigate between buttons with the arrow keys and press the Space key, which I have configured to press a button, the event doesn’t trigger. Do you know if I’m missing something in the configuration? Am I overlooking something?

    image

    https://youtu.be/AL3AMgoD07U
    Post edited by vlakdo on
  • Did a quick test and working fine here - both click or accepting via input keys will invoke the button's onClick events, e.g. startging an animation machine.

    Do you have a debug output (Unity Console node) in the machine's schematic to check if it's started?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • @gamingislove Thank you for responding. Yes, I’m reviewing it again, and the button I had configured was not the Space key but the Enter key. Now it works. Thanks!
Sign In or Register to comment.