public static bool BoxCast(Vector3 center,
Vector3 halfExtents,
Vector3 direction,
Quaternion orientation = Quaternion.identity,
float maxDistance = Mathf.Infinity,
...);
These are the parameters for a boxcast in Unity3D. I am confused over the purpose of the maxDistance
parameter as we already draw the box with the halfExtents
parameter. What if I don't want to move the box? I.e., I want to draw a box and get information about whatever is inside of it. I am not looking to move the box. Using maxDistance = 0
seems to do nothing as it does not register any hits. Using maxDistance > 0
will move the box, and I am looking to avoid this.
How can I use BoxCast(), avoiding moving the box?