Sliders and Handles
Updated: May 7, 2026
This sample demonstrates five core interaction patterns for constrained grab and poke interactions using the Interaction SDK (ISDK): free-sliding sliders, multi-position snap controls, rotation levers, two-handed grabs, and poke-activated buttons.
- Use OneGrabTranslateTransformer and OneGrabRotateTransformer to constrain grab interactions to specific axes
- Implement snap-to-position sliders by combining ISDK physics with custom snapping logic
- Bridge ISDK interaction events to Unity Events using PointableUnityEventWrapper and InteractableUnityEventWrapper
- Configure TwoGrabFreeTransformer for two-handed interactions
- Set up poke interactions with PokeInteractable and surface definitions
Device: Meta Quest headset with hand tracking enabled
Development environment: Unity with Meta XR SDK and Interaction SDK installed
For complete setup instructions, see the Meta Quest Developer Setup guide.
The sample is available in the Unity-InteractionSDK-Samples repository. After opening the project in Unity, open the scene at Assets/ShowcaseSamples/SlidersandHandles/Scenes/SlidersandHandles.unity. See the repository README for detailed build and deployment instructions.
| File / Scene | What it demonstrates | Key concepts |
|---|
SlidersandHandles.unity | All five interaction patterns in a single scene | Scene layout, ISDK interaction rig integration |
prefabs/Slider No Snapping.prefab | Free-sliding grab constrained to X-axis | OneGrabTranslateTransformer, min/max constraints |
prefabs/Slider Multiple Snap.prefab | Five-position snap slider with gear indicator | Snap-to-position pattern, custom script integration |
prefabs/Slider Toggle Snap.prefab | Binary on/off snap toggle | Two-position snapping, label visibility toggling |
prefabs/Slider Large Sphere.prefab | Free-sliding grab with large handle | Handle form factor variation |
prefabs/Slider Tiny Sphere.prefab | Free-sliding grab with tiny handle | Handle form factor variation |
prefabs/Horizontal.prefab | Rotation lever constrained to horizontal axis | OneGrabRotateTransformer, rotation limits |
prefabs/Vertical.prefab | Rotation lever constrained to vertical axis | OneGrabRotateTransformer, rotation limits |
prefabs/LargeLeverTwoHands.prefab | Two-handed grab with constrained translation | TwoGrabFreeTransformer, single-grab disabled |
prefabs/ButtonToggle.prefab | Poke-activated push button with animation | PokeInteractable, Animator integration |
prefabs/Toggle Button.prefab | Poke-activated push button | PokeInteractable, CircleSurface, PlaneSurface |
SCRIPTS/StepsMove.cs | Five-position snap logic with gear indicator | Snap-on-release, threshold-based position detection |
SCRIPTS/ToggleMove.cs | Binary snap toggle logic | Two-position snapping, visual state management |
SCRIPTS/BasicToggle.cs | Animator-driven toggle state | ISDK event to Animator parameter bridge |
When you run this scene, you see five groups of interactive objects arranged at chest height. On the left, three sliders demonstrate free-sliding and snap-to-position behaviors. The multi-snap slider displays gear numbers 0-4 as you move it, then snaps to the nearest position when released. The center-left group shows horizontal and vertical rotation levers that rotate within a limited range. The center displays large and tiny sphere-handled sliders to demonstrate different grip sizes. The center-right features a large lever that requires two hands to grab. The right side presents two poke-activated buttons that depress when you press them with your finger.
Notice how the sample uses different transformer components to create distinct interaction types from the same core ISDK stack. All grab-based prefabs share Grabbable, HandGrabInteractable, HandGrabPose, and PhysicsGrabbable components. The transformer determines behavior: OneGrabTranslateTransformer creates sliders, OneGrabRotateTransformer creates rotation levers, and TwoGrabFreeTransformer creates two-handed interactions. For detailed configuration, see the transformer components in Slider No Snapping.prefab, Horizontal.prefab, and LargeLeverTwoHands.prefab.
Reference: Grabbable API, Transformers API
The sample demonstrates how to connect ISDK interaction events to custom scripts using PointableUnityEventWrapper and InteractableUnityEventWrapper. In StepsMove.cs, the wrapper’s Select/Unselect events call the public SetMoving(bool) method, which sets a flag that drives the Update loop:
private void Update()
{
if (_isMoving) CheckStatus();
else SnapToPlace();
}
While grabbed, CheckStatus() provides real-time feedback. On release, SnapToPlace() moves the handle to the nearest discrete position. This pattern separates ISDK interaction handling from custom domain logic. See SCRIPTS/StepsMove.cs and Slider Multiple Snap.prefab for the complete wiring.
Reference: Unity Event Wrappers API
Snap-to-position implementation
The sample shows how ISDK handles smooth grab physics while custom scripts add discrete snapping. In StepsMove.cs, CheckStatus() continuously monitors the handle’s X position and determines the current gear (0-4) based on position thresholds. On release, SnapToPlace() sets the handle’s localPosition.x to the exact gear center position. This architecture keeps ISDK responsible for grab interaction while custom logic handles position quantization. See the complete implementation in SCRIPTS/StepsMove.cs.
Reference: Transform Constraints
Poke interaction configuration
Poke-activated buttons use a different component stack from grab interactions. PokeInteractable requires a surface definition (PlaneSurface or CircleSurface) to detect finger contact. The sample combines PokeInteractable, PokeInteractableVisual for button depression feedback, and PointableUnityEventWrapper to trigger BasicToggle.Toggle() on release. See ButtonToggle.prefab for the complete poke interaction setup, including the Animator integration.
Reference: PokeInteractable API
- Add detent feedback: Extend StepsMove.cs with haptic feedback when the slider crosses each gear threshold, reinforcing each snap point with a tactile pulse.
- Create a radial dial: Combine OneGrabRotateTransformer with a custom script that maps rotation angle to discrete values, creating a circular selector for menu options.
- Implement dual-slider controls: Combine two Slider No Snapping prefabs to create a two-dimensional control surface, such as a mixing board fader or audio equalizer.