I have a script inside of the button that’s on a canvas. How can I execute some code or call a function when it is clicked?
In the inspector, you can set the buttons OnClick to a specific void, for example
publib Void buttonClick()
{
// do something
}
attach the script to a button or empty game object, assign the button onclick to it then select the void you want to excecute
Shown here
You can also use the interfaces to manually do this.
1 Like
Thanks everyone. I’ll try to apply this tomorrow.