Component:Grabbable

From Resonite Wiki

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


Component image 
Grabbable component as seen in the Scene Inspector

Grabbable is a complicated thing

— AlexFromAlaska

The Grabbable component allows you to grab any slot it is attached to, provided it has some type of Collider.

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. Some components stop their functionality when this field is disabled, but some don't.
ReparentOnRelease Bool The slot is reparented to the value of _lastParent, instead of root when dropped *
PreserveUserSpace Bool The slot is reparented to Local User Space *
DestroyOnRelease Bool The slot this component is attached to is destroyed upon release
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.
GrabPriorityWhenGrabbed Nullable`1<Int> Optionally changes the grab priority of the object when it is already being grabbed. Useful for different behavior when it can be grab stolen by another player.
CustomCanGrabCheck delegate of identity GrabCheck Not Usable inside Resonite Requires a mod for interacting with Sync Delegates
EditModeOnly Bool Determines if this grabbable is effective only in Edit Mode
AllowSteal Bool Other users can grab the slot this component is attached to. Like a flag in capture the flag.
DropOnDisable Bool The parent slot will be dropped when this component is disabled.
ActiveUserFilter ActiveUserHandling Changes if this component can be grabbed based on who is the active user if any.
OnlyUsers list of UserRef A list of users that are allowed to grab this slot.
Scalable Bool Scalable determines if the grabbable's slot can be scaled.
Receivable Bool Receivable determines if a grabbable can be dropped onto a GrabbableReceiverSurface when let go of. The receivable has to be close enough for the receiver to receive it.
AllowOnlyPhysicalGrab Bool Only allow grab an object with a physical interaction - remote grabs are not allowed
_grabber Grabber Automatically Assigned, the grabber that is grabbing this component.
_lastParent Slot Automatically Assigned, the last parent this slot had. Is used to parent the slot back (if allowed) when let go of.
_lastParentIsUserSpace Bool Automatically Assigned Whether the last parent slot is the user space slot of the user grabbing this.
__legacyActiveUserRootOnly Bool Automatically Assigned Legacy do not use. Used to handle whether only the active user can grab. Use ActiveUserFilter instead!

Behavior

The interaction between ReparentOnRelease, PreserveUserSpace and any Grabbable Extensions, such as GrabbableReparentBlock, is somewhat complex.

When released, the following will be evaluated, in order:

  1. If ReparentOnRelease is true, the slot will be parented to the value in _lastParent
  2. If PreserveUserSpace and _lastParentIsUserSpace is true, the slot will be parented to Local User Space
  3. If an IGrabbable exists above this component in the hierarchy, and it is within the MaxDepth specified in the block, the slot will be parented to Local User Space
  4. Otherwise, the slot is parented to root.

You can drive the scale of a Grabbable object if the Scalable boolean is false.

Examples

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


See Also

  • IGrabbable for a list of grabbable types that act similar but not the same as this component.