ProtoFlux:Raycaster

From Resonite Wiki
Revision as of 20:31, 15 April 2024 by AmasterAmaster (talk | contribs) (Changed the note from information to suggestion.)
Raycaster
Origin
HasHit
Direction
HitCollider
MaxDistance
HitDistance
HitTriggers
HitPoint
UsersOnly
HitNormal
Root
HitTriangleIndex
Physics

The Raycaster node allows raycast checks, and can take in parameters that sets up the raycast and the validity of what it checks for. When this raycast detects a valid collider, it returns data pertaining to that hit.

This node returns data per frame, and is very useful for debugging and testing hit detection due to its constant updates.

This node can be combined with the Hit UV Coordinate node to get further data from this hit, such as a 2D location point on the collider for example.

If you want the same functionality as this node, but want to control when it checks for valid hits, use Raycast One instead.

Inputs

Origin (float3)

The point where we start this raycast.

Direction (float3)

The direction where this raycast should go in.

MaxDistance (float)

The maximum distance this raycast should go.

HitTriggers (bool)

Should this raycast hit trigger colliders.

UsersOnly (bool)

Should this raycast only hit users.

Root (Slot)

The slot hierarchy this raycast should check for when hitting slots, and only return data from slots it hit from within that slot hierarchy.

Outputs

HasHit (bool)

Returns if the raycast hit anything that is valid.

HitCollider (ICollider)

The collider we detected from this raycast.

HitDistance (float)

The distance from where we hit a valid collider.

HitPoint (float3)

The point in 3D space where we hit this valid collider.

HitNormal (float3)

The facing normal that we hit from a valid collider.

HitTriangleIndex (int)

The triangle mesh number we hit.