ProtoFlux:Raycast One: Difference between revisions

From Resonite Wiki
Created a page for the Raycast One node.
 
Changed the note from information to suggestion.
Line 29: Line 29:
This node can be combined with the [[ProtoFlux:Hit UV Coordinate|Hit UV Coordinate]] node to get further data from this hit, such as a 2D location point on the collider for example.
This node can be combined with the [[ProtoFlux:Hit UV Coordinate|Hit UV Coordinate]] node to get further data from this hit, such as a 2D location point on the collider for example.


{{Note|If you want the same functionality as this node, but want to check for valid hits continuously, use [[ProtoFlux:Raycaster|Raycaster]] instead.|information}}
{{Note|If you want the same functionality as this node, but want to check for valid hits continuously, use [[ProtoFlux:Raycaster|Raycaster]] instead.|suggestion}}


== Inputs ==
== Inputs ==

Revision as of 20:32, 15 April 2024

Raycast One
*
OnHit
Origin
OnMiss
Direction
HitCollider
MaxDistance
HitDistance
HitTriggers
HitPoint
UsersOnly
HitNormal
DebugDuration
HitTriangleIndex
Root
Physics

The Raycast One node allows raycast checks when impulses are received, 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 and fires from the OnHit continuation output. When there is no valid colliders hit (whether it is due to not being a valid target or could not be reached), the OnMiss continuation output fires.

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 check for valid hits continuously, use Raycaster instead.

Inputs

* (Call)

Calls an impulse to start the raycast check with the given parameters.

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.

DebugDuration (float)

Shows a debug line of where this raycast came from and how far it went, as well as showing this line for the given duration.

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

OnHit (Continuation)

This gets fired when a valid collider has been hit by this raycast.

OnMiss (Continuation)

This gets fired when there is no valid collider detected by his raycast.

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.