Extensions.SphereCast

Extension Method in Extensions

Declaration

public static bool SphereCast(this UnityEngine.CharacterController character, Vector3 direction, out RaycastHit hit, float maxDistance, LayerMask layerMask)

Description

Performs a sphere cast from the character's position.

Parameters

characterThe character to perform the cast from.
directionThe direction to perform the cast.
hitThe resulting hit information.
maxDistanceThe max length of the cast.
layerMaskThe layer mask to use.

Returns

boolTrue if any intersections were found.