dontgothroughthings

I don’t know what is wrong with this code. Please help with the two errors.

Here is the code:

if (Physics.Raycast(previousPosition, movementThisStep, hitInfo, movementMagnitude, layerMask.value))

Here are the two errors that Unity gives me:

Argument ‘#3’ is missing ‘out’ modifier

The best overloaded method match for `UnityEngine.Physics.Raycast(UnityEngine.Vector3, UnityEngine.Vector3, out UnityEngine.RaycastHit, float, int)’ has some invalid arguments

Just give the third parameter an “out” like

if (Physics.Raycast(previousPosition, movementThisStep, out hitInfo, movementMagnitude, layerMask.value))

“out” only says that the receiver is getting a reference to the object instead of just a copy (as far as I know).