I’m reading the reference for Physics.Raycast here-
My confusion is that there are several different parameter combinations, often using the same number of parameters but for different things.
How does Unity (or more importantly me) know which parameter is what? Is it smart enough to know based on data type? For example knowing that I’m giving it hitInfo because it’s a Vector3 as opposed to distance, which would expect a float. This seems like the only explanation to me, but I don’t like to make assumptions.
Also, it seems that the layerMask parameter is optional in every case. How do I know when parameters are optional or mandatory, without guessing from the usage example? Is this something that always applies to the layerMask parameter?
I’m sorry if this is a stupid question, but it’s hard to help myself from the help files when I’m too stupid to understand the help. ![]()