How do I do gestures in Vision Pro?

Generated on 7/31/2024

1 search

To implement gestures in Vision Pro using visionOS, you can utilize a variety of system gestures that are built into the platform. Here are some key points on how to use gestures:

  1. System Gestures:

    • Tap Gesture: Look at an object and tap two fingers together.
    • Double Tap Gesture: Similar to the tap gesture but performed twice.
    • Pinch and Hold Gesture: Pinch your fingers together and hold to interact with objects.
    • Pinch and Drag Gesture: Pinch and then drag to move objects.
    • Two-Handed Gestures: Use both hands to zoom in/out or rotate objects.

    These gestures are intuitive and do not require additional equipment, making them easy for players to use right out of the box. They work across different spaces in visionOS, from shared spaces to full immersion.

  2. Combination Gestures:

    • You can combine system gestures to create unique interactions. For example, you can detect when multiple gestures happen simultaneously or sequentially.
    • You can also combine gestures with keyboard modifiers or use spatial event gestures for low-level access to gesture events like tap begins, moves, or ends.
  3. Custom Gestures:

    • You can define your own gestures using full hand skeleton tracking provided by ARKit.
    • Custom gestures should be easy to learn and remember, and they should fit intuitively with the actions in your game.
    • For example, in the game Blackbox, a custom gesture is used to create a new bubble in the environment.
  4. Direct vs. Indirect Input:

    • Direct Input: Interact with virtual objects directly by reaching out and handling them.
    • Indirect Input: Operate on objects at a distance by looking at them and using small hand movements, which are amplified into big actions.

For more detailed information, you can refer to the session Explore game input in visionOS (03:33).

Relevant Sessions

  1. Explore game input in visionOS

If you need more specific details or code examples, feel free to ask!