Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (16 sloc) 690 Bytes

Raycast

Reflect

Creates a raycast that can reflect off certain objects in a layer mask.

Vector3[] linePositions = CandyCoded.Raycast.Reflect(gameObject.transform.position,
    gameObject.transform.forward, distance, layerMask);

lineRenderer.positionCount = linePositions.Length;
lineRenderer.SetPositions(linePositions);

Objects that are hit can also be returned to an array by reference.

List<RaycastHit> hits;

Vector3[] linePositions = CandyCoded.Raycast.Reflect(gameObject.transform.position,
    gameObject.transform.forward, distance, layerMask, out hits);

You can’t perform that action at this time.