Fixed typo. |
this needed a clean up |
||
Line 6: | Line 6: | ||
|Name=GrabbableReceiverSurface | |Name=GrabbableReceiverSurface | ||
}} | }} | ||
The '''GrabbableReceiverSurface''' component allows you to set up an object so that [[Component:Grabbable|Grabbable]] objects snap to its surface when a user releases the [[Component:Grabbable|Grabbable]] object within range of it. | |||
The '''GrabbableReceiverSurface''' component allows you to set up an object so that [[ | |||
Add Component Path: Transform > Interaction > GrabbableReceiverSurface. | Add Component Path: Transform > Interaction > GrabbableReceiverSurface. | ||
= | = Fields = | ||
{{Table ComponentFields | {{Table ComponentFields | ||
|ParentPlaced|Bool| Whether the [[ | |ParentPlaced|Bool| Whether the [[Component:Grabbable|Grabbable]] object gets reparented to this object's Slot or the Slot specified in OverrideParent. | ||
|OverrideParent|Slot| If not null, the slot that the [[ | |OverrideParent|Slot| If not null, the slot that the [[Component:Grabbable|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. | |TweenTime|Float| The amount of time in seconds for the animation effect when the object snaps to the surface. | ||
|MaxDistance|Float| | |MaxDistance|Float| How far away in meters something released gets grabbed. | ||
|Offset|Float| The distance from the surface that the [[ | |Offset|Float| The distance from the surface that the [[Component:Grabbable|Grabbable]] object will stop at. | ||
|CheckOffset|Float| | |CheckOffset|Float| How far away from the surface that the object ignores before it starts looking for released objects. | ||
|Directions|{{RootFieldType|SyncFieldList`1|[[Type:Float3|Float3]]}}|TypeAdv6=true|List of directions a [[ | |Directions|{{RootFieldType|SyncFieldList`1|[[Type:Float3|Float3]]}}|TypeAdv6=true|List of directions a [[Component:Grabbable|Grabbable]] object can be received from. | ||
|TagFilter|{{RootFieldType|TagFilter}}|TypeAdv7=true| | |TagFilter|{{RootFieldType|TagFilter}}|TypeAdv7=true| A filter that limits what can be picked up by this surface. | ||
}} | }} | ||
= Behavior = | = Behavior = | ||
Line 55: | Line 37: | ||
# 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 | # 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. | # After both distance checks a final distance value is provided. | ||
# The [[ | # The [[Component:Grabbable|Grabbable]] then selects the surface with the smallest distance and tells the Surface to receive it. | ||
# The Surface will then position the [[ | # The Surface will then position the [[Component:Grabbable|Grabbable]] upon the surface using an Animation of a <code>Tween Time</code> value is set. | ||
# The Surface will then parent the [[ | # The Surface will then parent the [[Component:Grabbable|Grabbable]] to itself or the <code>OverrideParent</code> location if the <code>ParentPlaced</code> checkbox is checked. | ||
= Examples = | = Examples = | ||
Line 67: | Line 49: | ||
= Frequently Asked Questions = | = Frequently Asked Questions = | ||
== Can objects which are not grabbed be received? == | == Can objects which are not grabbed be received? == | ||
No, this component only works with [[ | No, this component only works with [[Component:Grabbable|Grabbable]] objects which are released by a user. | ||
== Can this be used with objects that are not Grabbable? == | == Can this be used with objects that are not Grabbable? == | ||
No, It cannot be used with objects that do not have a [[ | No, It cannot be used with objects that do not have a [[Component:Grabbable|Grabbable]] component. | ||
= | = See Also = | ||
* [[ | * [[Component:Grabbable|Grabbable]] | ||
* [[ | * [[Component:GrabbableParenter|Grabbable Parenter]] | ||
</translate> | </translate> | ||
[[Category:Components{{#translation:}}|Grabbable Receiver Surface]] | [[Category:Components{{#translation:}}|Grabbable Receiver Surface]] | ||
[[Category:Components:Transform:Interaction{{#translation:}}|Grabbable Receiver Surface]] | [[Category:Components:Transform:Interaction{{#translation:}}|Grabbable Receiver Surface]] |
Revision as of 22:00, 4 January 2025
This article or section is a Stub. You can help the Resonite Wiki by expanding it.
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.
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. |
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 | How far away in meters something released gets grabbed. |
Offset
|
Float | The distance from the surface that the Grabbable object will stop at. |
CheckOffset
|
Float | How far away from the surface that the object ignores before it starts looking for released objects. |
Directions
|
direct SyncFieldList`1<Float3> | List of directions a Grabbable object can be received from. |
TagFilter
|
direct TagFilter | A filter that limits what can be picked up by this surface. |
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 of 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.