Hello,
I just suddenly encountered this problem. No matter what script I assign to this button, it doesn’t give me any functions’ option.
What might be the cause of it?
You have to add the script to a Game Object, assign that Game Object to the OnClick() and then you’ll see the methods from that script in there. Hope this helps!
Hii, there is a game object with the associated scrpit that makes the program work already ![]()
I meant there for the OnClick, I highlighted in red. It shows a script, not a Game Object if I can see it correctly. I tried it here and got the same result as you.
Ohhhh it works as you suggested! Thank youuuu:smile:![]()
Really? What a “rear-end to elbow” solution. Is there any particular logic to this? Quite honestly, this is such a confusing path that I’ve searched and searched and only by stupid chance came upon this thread.
We’re in the process of developing UI Toolkit to be a better solution for runtime UI, but this has been the case for UGUI for a long time now, so sorry you had so much trouble finding a solution to your issue! If you check the content in Unity Learn you can probably find many different examples of this.

