UnityEngine.Physics2D.LinecastAll C# (CSharp) Method

LinecastAll() public static method

Casts a line against colliders in the scene.

public static LinecastAll ( Vector2 start, Vector2 end, [ layerMask, [ minDepth, [ maxDepth ) : RaycastHit2D[]
start Vector2 The start point of the line in world space.
end Vector2 The end point of the line in world space.
layerMask [ Filter to detect Colliders only on certain layers.
minDepth [ Only include objects with a Z coordinate (depth) greater than or equal to this value.
maxDepth [ Only include objects with a Z coordinate (depth) less than or equal to this value.
return RaycastHit2D[]
        public static RaycastHit2D[] LinecastAll(Vector2 start, Vector2 end, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
        {
            return INTERNAL_CALL_LinecastAll(ref start, ref end, layerMask, minDepth, maxDepth);
        }

Same methods

Physics2D::LinecastAll ( Vector2 start, Vector2 end ) : RaycastHit2D[]
Physics2D::LinecastAll ( Vector2 start, Vector2 end, int layerMask ) : RaycastHit2D[]
Physics2D::LinecastAll ( Vector2 start, Vector2 end, int layerMask, float minDepth ) : RaycastHit2D[]
Physics2D