ProtoFlux:Get Object Root: Difference between revisions

From Resonite Wiki
add getobjectroot
 
m Links, minor rewordings
 
(6 intermediate revisions by 3 users not shown)
Line 13: Line 13:
|}}
|}}


Returns the root [[Slot | slot]] of an object from one slot from the specified object.
Returns the "root" [[Slot|slot]] of an object, from a slot child input.


== Inputs ==
== Inputs ==


=== Instance ===
=== Instance ([[Slot|Slot]]) ===


A [[Type:Slot | slot]] within the object you want the root of.
A [[Type:Slot | slot]] within the object you want the root of.


=== OnlyExplicit ===
=== OnlyExplicit ([[Type:Bool|bool]]) ===


: '''Help needed'''
If this is true, only slots with an [[Component:ObjectRoot|ObjectRoot]] component will be considered a root.
 
If this is false, slots containing a component implementing <code>IObjectRoot</code> are also considered roots. These are:
 
* [[Component:LegacyPanel|LegacyPanel]]
* [[Component:SceneInspector|SceneInspector]]
* [[Component:ObjectRoot|ObjectRoot]]
* [[Component:Grabbable|Grabbable]]
* [[Component:ProtoFluxNode|ProtoFluxNode]]


== Outputs ==
== Outputs ==


=== * ===
=== * ([[Slot|Slot]]) ===


Will return a [[Type:Slot | slot]] being the root of the object having an [[ObjectRoot (Component) | ObjectRoot]] component.
Will return a [[Slot|slot]] being the root of the object. If no slot was found, the input slot is returned.


If no such component is found, the initial slot itself will be returned.
== Examples ==


== Examples ==
<gallery widths=480px heights=480px>
File:GetObjectRootExample.png| Two nodes setup showing how to use the Get Object Root ProtoFlux node
</gallery>


[[File:GetObjectRootExample.png | 750px | Two nodes setup showing how to use the Get Object Root ProtoFlux node.]]
Using this node on a hit collider slot of a Grabbable object with OnlyExplicit set to false you can get the slot containing the Grabbable component which is most likely going to be the object's root, even if the object doesn't have a explicit ObjectRoot component.


[[Category:ProtoFlux:Slots]]
[[Category:ProtoFlux:Slots]]

Latest revision as of 07:10, 4 March 2024

Get Object Root
Instance
*
OnlyExplicit
Slots

Returns the "root" slot of an object, from a slot child input.

Inputs

Instance (Slot)

A slot within the object you want the root of.

OnlyExplicit (bool)

If this is true, only slots with an ObjectRoot component will be considered a root.

If this is false, slots containing a component implementing IObjectRoot are also considered roots. These are:

Outputs

* (Slot)

Will return a slot being the root of the object. If no slot was found, the input slot is returned.

Examples

Using this node on a hit collider slot of a Grabbable object with OnlyExplicit set to false you can get the slot containing the Grabbable component which is most likely going to be the object's root, even if the object doesn't have a explicit ObjectRoot component.