Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

ProtoFlux:RaycastAll

Performs a multi raycast check when an impulse is received and gives a Collection of hits in return.
Raycast All
*
OnHit
Origin
OnMiss
Direction
Hits
MaxDistance
HitTriggers
DebugDuration
Root
Physics

The Raycast All node performs a multi raycast check when an impulse is received and gives a Collection of hits. The input parameters determine from where, in what direction, and how far the ray should be cast as well as determining which colliders are valid hits. These parameters are in the space of the Root input, transforming it transforms how the raycast behaves. When the raycast hits at least one valid collider, OnHit is fired. If there is no valid hit, whether there were no colliders hit or the ones hit were not valid targets, the OnMiss continuation output fires.

The data output is a Collection that contains a list of every hit along it's trajectory, in order from closest collider to furthest. Each result can be decoded in a ForEach loop using UnpackRaycastHit.

If you only care about the first hit, use Raycast One instead.

Inputs

* (Call)

Performs a raycast with the input parameters when an impulse is received.

Origin (float3)

The starting position from which the ray is cast. Default is [0;0;0]. This position is in the space of the Root input.

Direction (float3)

The direction in which the ray is cast. Default is [0;0;0] which results in no ray being cast. This vector is in the space of the Root input, and doesn't have to be normalized.

MaxDistance (float)

The maximum distance the raycast should travel from its origin. Default is the maximum float value which is extremely high. It is a multiplier to Direction, adding Direction scaled by MaxDistance with Origin gives the end point of the raycast.

HitTriggers (bool)

Determines whether colliders with the Trigger, StaticTrigger or StaticTriggerAuto ColliderType values are valid hit targets. Default is False.

DebugDuration (float)

Determines the duration in seconds that a debug visual will be shown after each raycast. Default is -1, which disables the debug visual. When enabled, the visual shows a yellow line indicating the full path of the raycast along with the hit point (red spheres) and hit normal direction (blue arrows).

Root (Slot)

The slot in whose coordinate space the Origin, Direction and MaxDistance values should be evaluated. Default is the world root slot, i.e. the values are treated as being in the global coordinate space.

Outputs

OnHit (Continuation)

Fires an impulse if any valid hits were found when performing a raycast.

OnMiss (Continuation)

Fires an impulse in any situation where no valid hits is not found when performing a raycast.

A List of every collider that the ray has hit, in order from closest to furthest. The ordering is by the order of hit faces, not by collider origin.

Usage