Using UI Buttons and Sliders with Udon Events

If you’re tired of using just cubes or the likes as your buttons, here’s a tutorial video on using Unity’s built-in UI system for your buttons, options, or anything you can think of!
This video focuses more on UdonSharp, but there’s screenshots at the end for the Graph alternatives. (I forgot to make them during the video)


In your code theres a line called _button. Do we have to use that spelled exactly? I change the original name of my button in the hierachy to MirrorButton. Do i have to use _mirrorButton

Nope! Variable names can be whatever you’d like typically, I simply use _ before private variables. That’s just a way I do it personally.

I tried following your example both with C# and udon behavior but i cant get my mirror to toggle with the button. I watched your video 3 times (Great tutorials BTW thanks alot!) to make sure i was doing things right but still no succes. Is there another way to make it work or mayber download your files?

Woops, I totally forgot about this website haha
Sorry! And it seems I maayyy have not tested the Graph version. The way it’s presently set up, it’s looking at whether or not the BUTTON is enabled in the scene. For the “Game Object Get Active In Hierarchy” node, you need to have another strand coming out from your “target” variable node going into the Instance slot. My bad!