HoldOntoBehaviour
Description
The HoldOntoBehaviour component enhances immersion by ensuring that the visualized controller or hand firmly "holds onto" an interactable object during interaction. Instead of relying on raw sensor data for positioning, this behavior locks the controller to the object, making it ideal for realistic interactions with door knobs, levers, and similar objects.
Properties
| Name | Description |
|---|---|
| Sorting Order | Behaviours with a higher sorting order will always be executed after the ones with a lower sorting order. |
| Target Handedness | The handedness of the interactor to perform the Behaviour for. The Behaviour will only be performed, if the handedness is a match. |
| Hint | Optional: The pose to hold / grab onto when locking onto this interactable. Must be a child transform of the component transform. If not set, the component transform is used. |
| Smooth | If set, the controller visualizer will smoothly lock to the interactable instead of instantly. |
| Smoothing Duration | Duration in seconds to sync the visualizer pose with the interactable. The value is in seconds per unit and will interpolate based on distance. So if the visualizer is 5 units away, the total sync duration is five times the configured duration. |
Setup
- Add the
Interactablecomponent to theGameObjectyou want to interact with and use theHoldOntoBehaviourwith - Configure the
GameObject'sRigidbodyandCollideras per your requirements - Add the
HoldOntoBehaviourto theGameObject - Optional: Add a child
Transformto the interactableGameObjectand assign it to theHoldOntoBehaviour'shintproperty in the inspector. Use it to configure the grab pose of the controller visualizer on the interactable - Optional: You can add multiple
HoldOntoBehaviours to the interactable should you need to adjust confugration depending on the controller's handedness - Optional: Add a GrabHandPoseBehaviour to define a hand pose when grabbing / holding onto the interactable object
Example

Resources
Additional samples and tutorials coming soon.