Component:GrabInstancer: Difference between revisions

From Resonite Wiki
→‎Related Components: spelled it wrong I think
fix Table and headers
Line 6: Line 6:
|Name=GrabInstancer
|Name=GrabInstancer
}}
}}
The '''GrabInstancer''' component spawns a new copy of <code>Template</code> and attaches it to the user's hand whenever the slot it is attached to is grabbed.
The '''GrabInstancer''' component spawns a new copy of <code>Template</code> and attaches it to the user's hand whenever the slot it is attached to is grabbed.


== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|Template|Slot| The slot that gets duplicated and grabbed when the GrabInstancer is grabbed.
|Template|Slot| The slot that gets duplicated and grabbed when the GrabInstancer is grabbed.
Line 16: Line 15:
|ActivateRoot|Bool| Whether or not the GrabInstancer should activate the newly duplicated slot.
|ActivateRoot|Bool| Whether or not the GrabInstancer should activate the newly duplicated slot.
|EnableGrabbable|Bool| Whether or not the GrabInstancer should activate any Grabbable component on the newly duplicated slot.
|EnableGrabbable|Bool| Whether or not the GrabInstancer should activate any Grabbable component on the newly duplicated slot.
|SetInstancePersistent|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Bool|Bool]]&gt;'''|TypeAdv3=true| Whether to set the duplicated object's persistence field, and what to set it to.
|SetInstancePersistent|'''[[Type:Nullable`1|Nullable`1]]&lt;[[Type:Bool|Bool]]&gt;'''|TypeAdv5=true| Whether to set the duplicated object's persistence field, and what to set it to.
|ExcludedParts|{{RootFieldType|SyncRefList`1|[[Type:Slot|Slot]]}}| slots will be skipped while duplicating
|ExcludedParts|{{RootFieldType|SyncRefList`1|[[Type:Slot|Slot]]}}|TypeAdv6=true| slots will be skipped while duplicating
|Physical|Bool| If true, the GrabInstancer only reacts to physical grab.
|Physical|Bool| If true, the GrabInstancer only reacts to physical grab.
|GrabPriority|Int| {{Template:Grab Priority}}
|GrabPriority|Int| {{Template:Grab Priority}}
}}
}}


== Behavior ==
== Usage ==


== Examples ==
== Examples ==
Line 28: Line 27:
<youtube>QFWU2dZTDvw</youtube>
<youtube>QFWU2dZTDvw</youtube>


== Related Components ==
== See Also ==
* [[Component:UIGrabInstancer|UIGrabInstancer]] is similar to this component but uses [[UIX]] elements to do this.
* [[Component:UIGrabInstancer|UIGrabInstancer]] is similar to this component but uses [[UIX]] elements to do this.



Revision as of 07:05, 19 January 2025


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

Component image 
GrabInstancer component as seen in the Scene Inspector

The GrabInstancer component spawns a new copy of Template and attaches it to the user's hand whenever the slot it is attached to is grabbed.

Fields

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. Some components stop their functionality when this field is disabled, but some don't.
Template Slot The slot that gets duplicated and grabbed when the GrabInstancer is grabbed.
ContainerTemplate Slot
ContainerTemplateInstanceRoot Slot
ActivateRoot Bool Whether or not the GrabInstancer should activate the newly duplicated slot.
EnableGrabbable Bool Whether or not the GrabInstancer should activate any Grabbable component on the newly duplicated slot.
SetInstancePersistent Nullable`1<Bool> Whether to set the duplicated object's persistence field, and what to set it to.
ExcludedParts list of Slot slots will be skipped while duplicating
Physical Bool If true, the GrabInstancer only reacts to physical grab.
GrabPriority Int Determines what gets grabbed if several grabbable objects are touching someone's grab sphere. The IGrabbable with the highest priority will be grabbed first. If the highest priority ties with another IGrabbable, it will grab both of those and ignore any lower priority IGrabbables.

Usage

Examples

A video tutorial about the GrabInstancer by ProbablePrime:

See Also