ProtoFlux:IsChildOf: Difference between revisions

From Resonite Wiki
added Is Child Of ProtoFlux Node Page
 
overhaul
Line 5: Line 5:
[
[
{"Name": "Instance", "Type": "Slot"},
{"Name": "Instance", "Type": "Slot"},
{"Name": "Instance", "Type": "Slot"},
{"Name": "Other", "Type": "Slot"},
{"Name": "IncludingSelf", "Type": "bool"}
{"Name": "IncludingSelf", "Type": "bool"}
]
]
Line 14: Line 14:
|}}
|}}


Returns if Instance ([[Slot|Slot]]) is a child of Other ([[Slot|Slot]]).
The '''Is Child Of''' node determines if the <code>Instance</code> slot is a descendant of the <code>Other</code> slot. This check is recursive.


== Inputs ==
== Inputs ==
Line 20: Line 20:
=== Instance ([[Slot|Slot]]) ===
=== Instance ([[Slot|Slot]]) ===


The slot to check if it is a child of Other ([[Slot|Slot]]).
The slot to test.


=== Other ([[Slot|Slot]]) ===  
=== Other ([[Slot|Slot]]) ===


The slot that should be used to check if Instance ([[Slot|Slot]]) is under it.
The potential parent slot of <code>Instance</code>.


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


{{Stub}}
If <code>True</code>, the node will return <code>True</code> if <code>Instance</code> is the same slot as <code>Other</code>. Otherwise, the node will return <code>False</code> in this case.


TODO: What is this?
== Outputs ==
 
== Outputs ==  


=== * ([[Types:Bool|bool]]) ===
=== * ([[Types:Bool|bool]]) ===


returns if Instance ([[Slot|Slot]]) is a child of Other ([[Slot|Slot]]).
Returns <code>True</code> if <code>Instance</code> is a descendant of the <code>Other</code> slot. Otherwise, returns <code>False</code>


== Examples ==
== Examples ==
<gallery widths=480px heights=480px>
File:ProtoFlux_example_is_child_of.webp|An example code using Is Child Of to check if an item is on a shelf.
</gallery>


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

Revision as of 18:06, 29 January 2025

Is Child Of
Instance
*
Other
IncludingSelf
Slots

The Is Child Of node determines if the Instance slot is a descendant of the Other slot. This check is recursive.

Inputs

Instance (Slot)

The slot to test.

Other (Slot)

The potential parent slot of Instance.

IncludingSelf (bool)

If True, the node will return True if Instance is the same slot as Other. Otherwise, the node will return False in this case.

Outputs

* (bool)

Returns True if Instance is a descendant of the Other slot. Otherwise, returns False

Examples