Meta accounts are here: you can create a Meta account to log into VR devices. Learn more

RAYCAST WITH OVERRIDES

Enables a raycast gizmo with overrides for position and direction.

Appearance in Composition Pane
Description

Raycast with overrides will cause the specified raycast gizmo to fire a data-gathering beam from an origin position, with a given direction. A raycast gizmo must be referenced in the first parameter, but will fire from the given position and direction. The data gathered by the raycast can then be extracted with the get raycast data.
Parameters

object, vector, vector

PREREQUISITE READING

RAYCAST precedes this tutorial


Example 1: Aiming scope

Imagine this script attached to an aiming scope, when the event aim is received, raycast causes ray1 to fire a beam in its direction. If the get raycast data registers a hit, then the event fire is sent back to self, passing in a parameter containing the hit position. When fire is received, a second raycast gizmo, ray2, fires from its position directly at the positional coordinates that were passed in.