Component:AvatarDestroyOnDequip: Difference between revisions

From Resonite Wiki
add info
Mention that when AvatarDestroyOnDequip.DestroyRoot is null it deletes the component's slot. RIP 8 hours of work.
 
Line 9: Line 9:


<!--T:2-->
<!--T:2-->
The AvatarDestroyOnDequip component destroys DestroyRoot when the avatar it's in the hierarchy of is unequipped.   
The '''AvatarDestroyOnDequip''' component destroys <code>DestroyRoot</code> when the avatar it's in the hierarchy of is unequipped, or the slot the component is attached to if <code>DestroyRoot</code> is null.   


<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
{{Table ComponentFields
{{Table ComponentFields
|DestroyRoot|Slot| The slot to destroy when the avatar this component is a part of is dequipped.
|DestroyRoot|Slot| The slot to destroy when the avatar this component is a part of is dequipped, or null to destroy the slot this component is attached to.
}}
}}


<!--T:4-->
<!--T:4-->
== Usage ==
== Usage ==
Attach to a part of an Avatar's hierarchy and then provide a slot to <code>DestroyRoot</code> When the parent avatar is dequipped, <code>DestroyRoot</code> will be destroyed.
Attach to a part of an Avatar's hierarchy and then provide a slot to <code>DestroyRoot</code> (or keep it null to destroy the slot this component is on). When the parent avatar is dequipped, the target slot will be destroyed.


<!--T:5-->
<!--T:5-->

Latest revision as of 12:48, 7 December 2024


This article or section is a Stub. You can help the Resonite Wiki by expanding it.


Component image 
AvatarDestroyOnDequip component as seen in the Scene Inspector


The AvatarDestroyOnDequip component destroys DestroyRoot when the avatar it's in the hierarchy of is unequipped, or the slot the component is attached to if DestroyRoot is null.

Usage

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
DestroyRoot Slot The slot to destroy when the avatar this component is a part of is dequipped, or null to destroy the slot this component is attached to.

Usage

Attach to a part of an Avatar's hierarchy and then provide a slot to DestroyRoot (or keep it null to destroy the slot this component is on). When the parent avatar is dequipped, the target slot will be destroyed.

Examples

Can be used to remove slots that are generated when a user enters an avatar, but need to be destroyed when they leave said avatar. or it can destroy a slot outside the avatar, which could be used in puzzles or world systems.

Related Components