Capsule Cast
Node description and basic instructions
Last updated
Node description and basic instructions
Last updated
Casts a capsule against all colliders in the Scene and returns detailed information on what was hit.
The capsule is defined by the two spheres with radius around point 1 and point 2, which form the two ends of the capsule. Hits are returned for the first collider which would collide against this capsule if the capsule was moved along direction. This is useful when a Raycast does not give enough precision, because you want to find out if an object of a specific size, such as a character, will be able to move somewhere without colliding with anything on the way.
bool True when the capsule sweep intersects any collider, otherwise false.
Capsule Cast will not detect colliders for which the capsule overlaps the collider. Passing a zero radius results in undefined output and doesn't always behave the same as Raycast.
To create it, right-click on free space in AI Tree inspector and select Create Node/Tasks/Physics/Capsule Cast.
This task node has a number of fields, that are highlighted in picture below.
Node Name
Name of node
Ignore Abort Self
Whether node ignores abort self or not
Point 1
Center of the sphere at the start of the capsule
Point 2
Center of the sphere at the end of the capsule
Direction
Direction into which to sweep the capsule
Radius
Radius of the capsule
Max Distance
Max length of the cast (by default: infinity)
Culling Layer
Used to selectively ignore colliders when casting a Capsule Cast
Query Trigger Interaction
Specifies whether this query should hit Triggers
Message
Value of message
Argument
Argument of message in