Skip to main content

RaycastExtensions.SphereConeCastAll

Declaration#

public static RaycastHit[] SphereConeCastAll(Vector3 origin, float endRadius, Vector3 direction, float distance, float coneAngle, LayerMask layerMask)

Parameters#

NameDescription
originOrigin
endRadiusRadius at end
directionDirection of cone
distanceDistance/Length of cone
coneAngleAngle of cone
layerMaskLayermask

Description#

Perform a sphere based cone raycast and return all hits

Usage#

Example
using NullSave.GDTK;using UnityEngine;
public class Example : MonoBehaviour{
    public void ExampleMethod(float radius, float range, float coneAngle, LayerMask layerMask)    {        RaycastHit[] hits = RaycastExtensions.SphereConeCastAll(transform.position, radius, transform.forward, range, coneAngle, layerMask);    }
}