How to make a raycaste ui script.

I have a game in progress. I have a world space canvas and some buttons on it. The cursor is in lock state (btw it is a first person game) . I want to know how to click it using raycaste because normal clicks don’t work.

“…I want to know how to click it” Click what? The cursor itself? Please provide images, code, and what research you have done on google so far.

Here’s a practical example to use Graphics Raycaster:

You can find the reference to it in a component in your canvas.