How to Code a Button?

I’ve seen people do it, and i have an Idea on how to do it, I just don’t know the best way to do it. Do you use ray casting? Or FOV? I wanna make a button that toggles things on and off.

What kind of buton? It depends on what you want it to do.

What do you mean? Just a standard button. When you’re looking at it and press Interact it triggers something.

Use:

Distant Between
Button Held
View Angle
Just put the values you need in there.