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. When a raycast detects a valid collider, it returns data pertaining to that hit and fires from the OnHit continuation output. 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. The result can be decoded(after something like ForEach) 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].

Direction (float3)

The direction in which the ray is cast. Default is [0;0;0] which results in no ray being cast. (Use for example [0;0;1] for directly forward.)

MaxDistance (float)

The maximum distance the raycast should travel from its origin. Default is the maximum float value which is extremely high.

HitTriggers (bool)

Determines whether colliders with the Trigger, StaticTrigger or StaticTriggerAuto ColliderType value 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.

Usage