Created a page for the Is Disposed node. |
Whoops, needs it's own example file. |
||
Line 37: | Line 37: | ||
With this setup, and when the target slot is destroyed (and there is no longer any references to it), the '''DynamicReferenceVariable''' component will still have it stored on its field, showing the old ID along with it. This in turn makes the '''IsDisposed''' set to <code>true</code>. | With this setup, and when the target slot is destroyed (and there is no longer any references to it), the '''DynamicReferenceVariable''' component will still have it stored on its field, showing the old ID along with it. This in turn makes the '''IsDisposed''' set to <code>true</code>. | ||
<gallery widths=480px heights=480px>File: | <gallery widths=480px heights=480px>File:IsDisposed Node Example 01.png|IsDisposed Node Example 01</gallery> | ||
[[Category:ProtoFlux:References:Elements]] | [[Category:ProtoFlux:References:Elements]] |
Latest revision as of 04:40, 23 May 2024
The Is Disposed
node takes in a worker world element and returns if that element was disposed from the world. Destruction of the slot prevents the result from changing, as by the time the slot is gone, it is too late. There is however a method to check if something did get disposed, see the examples below.
Inputs
Element (Worker)
The worker world element in question.
Outputs
* (bool)
Returns if this element was disposed in this world.
Examples
There is a certain setup required to detect when a slot gets disposed, here is what you need and why:
- A Slot that holds 2 components, a Dynamic Variable Space component and a Dynamic Reference Variable component (we will use the Reference Type of a Worker). This will listen for any changes that happen.
- A Dynamic Variable Input node. Must be parented under the slot that is listening using the Dynamic Variable Space.
- This IsDisposed node, used to check if some element was disposed.
- A Continuously Changing Relay node, used to make sure it updates our value.
- A Fire On True node. We want to know when the element gets disposed at this exact moment.
- A Host User or Local User node, used for the Fire On True node.
With this setup, and when the target slot is destroyed (and there is no longer any references to it), the DynamicReferenceVariable component will still have it stored on its field, showing the old ID along with it. This in turn makes the IsDisposed set to true
.
-
IsDisposed Node Example 01