UnityEngine.Physics2D.LinecastNonAlloc C# (CSharp) Method

LinecastNonAlloc() public static method

Casts a line against colliders in the scene.

public static LinecastNonAlloc ( Vector2 start, Vector2 end, RaycastHit2D results, [ layerMask, [ minDepth, [ maxDepth ) : int
start Vector2 The start point of the line in world space.
end Vector2 The end point of the line in world space.
results RaycastHit2D Returned array of objects that intersect the line.
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 int
        public static int LinecastNonAlloc(Vector2 start, Vector2 end, RaycastHit2D[] results, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
        {
            return INTERNAL_CALL_LinecastNonAlloc(ref start, ref end, results, layerMask, minDepth, maxDepth);
        }

Same methods

Physics2D::LinecastNonAlloc ( Vector2 start, Vector2 end, RaycastHit2D results ) : int
Physics2D::LinecastNonAlloc ( Vector2 start, Vector2 end, RaycastHit2D results, int layerMask ) : int
Physics2D::LinecastNonAlloc ( Vector2 start, Vector2 end, RaycastHit2D results, int layerMask, float minDepth ) : int
Physics2D