Can you use a GUI button by Raycast?

Hey there. I am currently working on a VR game which I ran into a problem. Since VR users cant have on screen GUI. I came up with a solution to use a part and surface GUI. I was wondering if there is a way I can use a Raycast to get a button and some how use it. What I’m thinking if this is not possible if its better to just make buttons with parts. Thank you for reading.

Check VR service. I personally have to experience in VR what-so-ever, but I would assume that it would need to be a client-sided part with a SurfaceGUI facing towards the player. But I may be wrong.

I have that part done. I was just wondering if there was a way to detect the Button on the GUI surface.

you either want to
1: make the camera not move, send out a ray using the cframe of the camera (pretty simple),
2: do what games like vr hands does and make it detect when the hand object is touching (you need some gyros or whatever for the hand object im not too skilled in those),
3: just use startergui with screenguis (very simple)

as what you are describing using a part that is positioned with the camera seems like it could cause a lot of annoyance and possible sickness when moving around