UnityEngine.Physics2D.BoxCast C# (CSharp) Method

BoxCast() public static method

Casts a box against colliders in the scene, returning the first collider to contact with it.

public static BoxCast ( Vector2 origin, Vector2 size, float angle, Vector2 direction, [ distance, [ layerMask, [ minDepth, [ maxDepth ) : RaycastHit2D
origin Vector2 The point in 2D space where the shape originates.
size Vector2 The size of the shape.
angle float The angle of the shape (in degrees).
direction Vector2 Vector representing the direction of the shape.
distance [ Maximum distance over which to cast the shape.
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 BoxCast(Vector2 origin, Vector2 size, float angle, Vector2 direction, [DefaultValue("Mathf.Infinity")] float distance, [DefaultValue("DefaultRaycastLayers")] int layerMask, [DefaultValue("-Mathf.Infinity")] float minDepth, [DefaultValue("Mathf.Infinity")] float maxDepth)
        {
            RaycastHit2D hitd;
            Internal_BoxCast(origin, size, angle, direction, distance, layerMask, minDepth, maxDepth, out hitd);
            return hitd;
        }

Same methods

Physics2D::BoxCast ( Vector2 origin, Vector2 size, float angle, Vector2 direction ) : RaycastHit2D
Physics2D::BoxCast ( Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance ) : RaycastHit2D
Physics2D::BoxCast ( Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int layerMask ) : RaycastHit2D
Physics2D::BoxCast ( Vector2 origin, Vector2 size, float angle, Vector2 direction, float distance, int layerMask, float minDepth ) : RaycastHit2D
Physics2D