Skip to content

format

typescript
Physics.CapsuleCastAll(p0, p1, radius, direction, maxDistance, mask, cast_trigger)

class: Physics

description

Performs a capsule cast and returns all the hit objects that intersect with it.

This method casts a capsule-shaped ray in the scene to check for intersections with objects and stores the intersection information with all the objects.

parameter

param_nametypedescription
p0Vector3One endpoint of the capsule
p1Vector3The other endpoint of the capsule
radiusnumberThe radius of the capsule
directionVector3The direction in which the capsule is cast
maxDistancenumberThe maximum distance the capsule is cast
masknumberThe layers to perform collision detection with (bitwise operation)
cast_triggerQueryTriggerInteraction?Whether the ray should perform collision detection with triggers

return

typedescription
RaycastHit|undefinedWhether the ray intersects with an object, returns undefined if there is no intersection

code example