How can I include RayCast into a method? C#

Hi, I want to make a method that uses RayCast(…) But I need to know what I’m supposed to fill in for the variables types in the method (int, float, bool, Vector3, I don’t know what it’s supposed to be)

Here is a pseudo code that should give you an idea of what I’m trying to do:

public static float GetDistFromRay(Pos,Dir,Mask)
{
RaycastHit hit;
if (Physics.Raycast(Pos, Dir, out hit,Mask))
return hit.distance;
else return 0;
}

Anyone know what I’m supposed to put in the () next to “GetDistFromRay” in this example?

public static float GetDistFromRay(Vector3 Pos, Vector3 Dir, int Mask)The int Mask is a bitmask, not the index of the layer.