Skip to main content

Teleportation System

The HoloMIT SDK’s teleportation module enables users to move instantly within the environment using a raycast-driven pointer and a configurable arc. It works with Unity’s New Input System and the XR Interaction Toolkit to provide a smooth, VR-friendly teleport experience.


Overview

  • Draws an arc or straight ray from the controller to preview teleport destinations.
  • Supports selection and confirmation via configurable Input Actions.
  • Automatically disables the pointer visualization when the activation button is released.
  • Teleports the player’s transform to the detected ground point, applying a small offset along the surface normal to avoid clipping.

Requirements

  • Unity 2022.3 LTS or later
  • New Input System package enabled
  • XR Interaction Toolkit (for VR detection and controller tracking)
  • CharacterController or similar on the player’s body for collision handling (optional but recommended)

Setup

  1. Add the TeleporterController component to your player rig:
    • Assign the right-hand transform (rightHand).
    • Assign the player body transform (bodyTransform) that will teleport.
    • Provide materials for teleportable (lineTeleportableMat) and non-teleportable (lineNotTeleportableMat) surfaces.
  2. Configure the InputActionReferences:
    • teleportAction: button to activate the pointer (hold).
    • touchAction: (optional) for pointer feedback.
    • interactAction: button to confirm teleport destination.
  3. Set raycastLayers to include the valid teleport surface layers.
  4. (Optional) Enable canRotate and adjust rotationSpeed to allow snap or smooth rotation while aiming.
  5. Add the VRTeleporter component under your controller to enable arc-based teleportation:
    • Assign the positionMarker prefab to indicate landing points.
    • Configure angle, strength, and maxVertexcount to tune arc shape and performance.

Exposed Parameters

PropertyTypeDescription
teleportActionInputActionReferenceInput action to toggle the teleport pointer.
touchActionInputActionReferenceSecondary input for pointer feedback (optional).
interactActionInputActionReferenceInput action to confirm the teleport destination.
raycastLayersLayerMaskLayers considered valid for teleportation.
canRotateboolEnables rotation while aiming.
rotationSpeedfloatRotation speed when canRotate is enabled.
anglefloatLaunch angle for the arc in VRTeleporter (default: 45°).
strengthfloatInitial velocity multiplier for the arc (default: 10).
maxVertexcountintMaximum vertices for the arc to optimize performance.

Usage

  • Activate Pointer: Hold the teleportAction to show the pointer or arc.
  • Aim: Point at a valid surface; the material and marker update to indicate validity.
  • Confirm: Press the interactAction to teleport.
  • Automatic Cleanup: The pointer and marker hide automatically after teleporting.

Known Limitations

  • No built-in fade or blink transition; consider adding a screen fade for comfort.
  • Arc updates are frame-rate dependent; smoothing may be needed for consistent feedback.
  • Ground detection uses Unity physics; ensure valid colliders on teleport surfaces.
  • Teleport ignores obstacles between the marker and player; verify that landing areas are safe.