CapsuleCastNonAlloc(Vector3, Vector3, float, Vector3, RaycastHit[], float, int, QueryTriggerInteraction)
Casts a capsule against all colliders in the Scene and returns detailed information on what was hit into the buffer.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.PhysicsModule
public static int CapsuleCastNonAlloc(Vector3 point1, Vector3 point2, float radius, Vector3 direction, RaycastHit[] results, float maxDistance, int layerMask, QueryTriggerInteraction queryTriggerInteraction)
Parameters
The center of the sphere at the of the capsule.
startThe center of the sphere at the of the capsule.
endThe radius of the capsule.
The direction into which to sweep the capsule.
The buffer to store the hits into.
The max length of the sweep.
A Layer mask that is used to selectively filter which colliders are considered when casting a capsule.
Specifies whether this query should hit Triggers.
Returns
Type | Description |
|---|---|
| int | The amount of hits stored into the buffer. |
Remarks
Like Physics.CapsuleCastAll, but generates no garbage.