Version: 2018.2

Physics.CapsuleCastNonAlloc

Switch to Manual
public static int CapsuleCastNonAlloc (Vector3 point1, Vector3 point2, float radius, Vector3 direction, RaycastHit[] results, float maxDistance= Mathf.Infinity, int layerMask= DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction= QueryTriggerInteraction.UseGlobal);

Parameters

point1The center of the sphere at the start of the capsule.
point2The center of the sphere at the end of the capsule.
radiusThe radius of the capsule.
directionThe direction into which to sweep the capsule.
resultsThe buffer to store the hits into.
maxDistance@param distance Длина луча.
layermaskA Layer mask that is used to selectively ignore colliders when casting a capsule.
queryTriggerInteractionSpecifies whether this query should hit Triggers.

Returns

int The amount of hits stored into the buffer.

Description

Casts a capsule against all colliders in the scene and returns detailed information on what was hit into the buffer.

Like Physics.CapsuleCastAll, but generates no garbage.