This article or section is a Stub. You can help the Resonite Wiki by expanding it.
Intoduction
The GrabbableReceiverSurface component allows you to set up an object so that Grabbable objects snap to its surface when a user releases the Grabbable object within range of it.
Add Component Path: Transform > Interaction > GrabbableReceiverSurface.
Usage
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. |
ParentPlaced
|
Bool | Whether the Grabbable object gets reparented to this object's Slot or the Slot specified in OverrideParent. |
OverrideParent
|
Slot | If not null, the slot that the Grabbable object gets reparented to, if ParentPlaced is true. |
TweenTime
|
Float | The amount of time in seconds for the animation effect when the object snaps to the surface. |
MaxDistance
|
Float | |
Offset
|
Float | The distance from the surface that the Grabbable object will stop at. |
CheckOffset
|
Float | |
Directions
|
direct SyncFieldList`1<Float3> | List of directions a Grabbable object can be received from. |
TagFilter
|
direct TagFilter |
TagFilter:
Fields | ||
---|---|---|
Name | Type | Description |
Mode
|
TagFilterMode | Blacklist or Whitelist |
Tags
|
String | List of tags that the filter applies to. |
Behavior
When a GrabbableReceiverSurface is setup on an object, it will become visible to Grabbable objects when they are released from a user's grab. When this occurs the Surface will carry out some checks and if these pass the object will snap to the GrabbableReceiverSurface. If the ParentPlaced
checkbox is enable the Grabbable will be parented to the surface or the slot specified in OverrideParent
Explanation of the Checks
These are a little complicated but if you want to fully understand what happens it is provided.
When a user is holding a Grabbable object and let's go(releases it):
- The Grabbable object will look around it in its vicinity using a sphere collider based on the Object's bounding box plus a radius defined on the User's Hand
- If this collider overlaps with any objects which have GrabbableRecieverSurface attached to them then the Grabbable will perform some checks on each surface.
- First it asks the Surface to check its distance from the Grabbable object.
- The distance check first calculates if a Raycast from the released object towards the surface would hit in the directions specified in the component.
- If the Raycast would hit a distance is then calculated.
- This distance varies depending on the directions specified in the component's properties.
- For example, placing an object on top of a cube from above has a shorter distance to the top of the Cube than the bottom of a cube because the distance from above the cube to the bottom face of the cube is greater.
- If this distance is to great as specified in the component's properties a second check using the released object's bounding box corners is also computed
- After both distance checks a final distance value is provided.
- The Grabbable then selects the surface with the smallest distance and tells the Surface to receive it.
- The Surface will then position the Grabbable upon the surface using an Animation if a
Tween Time
value is set. - The Surface will then parent the Grabbable to itself or the
OverrideParent
location if theParentPlaced
checkbox is checked.
Examples
ProbablePrime's tutorial on GrabbleReceiverSurface:
Frequently Asked Questions
Can objects which are not grabbed be received?
No, this component only works with Grabbable objects which are released by a user.
Can this be used with objects that are not Grabbable?
No, It cannot be used with objects that do not have a Grabbable component.