c# overloaded function ambiguity

Hi!

I’m doing something funny in my code- when it tries to compile, I’m getting an error message:

"The best overloaded method for UnityEngine.Physics.Raycast( Vector3, Vector3, float, int) has some invalid arguments

and later:

Argument 3: cannot convert type RaycastHit to float.

This makes perfect sense considering the fact that I’m passing in the following parameters: Vector3, Vector3, RaycastHit, float which matches another one of the overloaded method’s parameter lists exactly. Why isn’t it finding that overloaded method? Do I need another using statement?

Thanks in advance!

Have you remembered to put the word “out” in front of the RaycastHit parameter?

No I was not remembering (or knowing, more specifically). Thanks very much!