Perform a raycast into the scene using screen coordinates and stores the results. Use Ray Distance to set how close the camera must be to pick the object.
A Vector3 screen position. Commonly stored by other actions.
X position on screen.
Y position on screen.
Are the supplied screen coordinates normalized (0-1), or in pixels.
The length of the ray to use.
Store Did Pick Object
Store whether the ray hit an object in a Bool Variable.
Store Game Object
Store the hit Game Object in a Game Object Variable.
Store the world position of the hit point in a Vector3 Variable.
Store the normal of the hit point in a Vector3 Variable.
Store the distance to the hit point.
Pick only from these layers. Set a number then select layers.
Invert the mask, so you pick from all layers except those defined above.
Repeat every frame.