Get Collision Point with camera.ScreenPointToRay?

Hello,
I am having a hard time finding the collision point in the camera.ScreenPointToRay function.
I know Physics.Raycast has a hit point:

Raycast (origin : Vector3, direction : Vector3, out hitInfo : RaycastHit, distance : float = Mathf.Infinity, layerMask : int = kDefaultRaycastLayers)

but i have no clue when using camera.ScreenPointToRay?

Thank you for helping me! :slight_smile:

Ray ray = camera.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray, out hit, Mathf.Infinity, mask)  hit.transform != null)
{
   //hit something
}

Or do a search here on the forum. This question (more or less) has been asked a few times.

Thanks for the reply,
i found another method,

by using this code:
var hit: RaycastHit;
Physics.Raycast(ray, hit);
I can then use the hit variable’s point, to get the position of where the raycast meets the world.