Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Question Create 'Clickable' Action in the Graph, for assigning to UI Toolkit 'Button' element

Discussion in 'Visual Scripting' started by BenjaminApprill, Sep 19, 2022.

  1. BenjaminApprill

    BenjaminApprill

    Joined:
    Aug 1, 2022
    Posts:
    30
    Hello.

    I am trying to subscribe to a button element without using C# code. I can access the button element using U Query Extensions, but the only options for assigning actions to this is through the 'Clickable' type.

    However, I've tried creating a 'Clickable' type in the graph, to no avail.

    Creating a Clickable requires an Action input, which requires an Object and a Method. The Method type is of 'int ptr', and I'm not sure how I would access that in the Graph...

    It would be nice to define some behavior in the graph, and subscribe that as the Action input for the Clickable type.
     
  2. BenjaminApprill

    BenjaminApprill

    Joined:
    Aug 1, 2022
    Posts:
    30
    For now, I've just moved on with a custom C# script node to handle the subscriptions.