Input Modules꞉ Follow - aestheticinteractive/Hover-UI-Kit GitHub Wiki

This module converts Unity transforms to cursors. This is typically used to map the "Look" cursor (with "Is Raycast" enabled) to the position and orientation of a VR/AR headset. This enables "look at" (or "gaze") selections, which are especially useful for mobile VR, where a 3D input device may not be available.

Cursors

Follow Cursors :camera: A single cursor, with "Is Raycast" enabled, following a headset.

This animation shows only the "Look" cursor, however, the input module allows any cursor to be mapped to a transform.

SDK

This input module is compatible with any VR/AR SDK that provides position and/or rotation information via Unity transforms. For example, many mobile VR setups (like Gear VR or Google Cardboard VR) control the Unity camera's rotation. Mapping the "Look" cursor to that camera transform provides immediate Hover UI Kit support for those devices, without needing a device-specific input module.

Scene

The input module scene is named HoverInputModule-Follow, located in the /Assets/Hover/InputModules/Follow/Scenes folder.

Installation

See the Input Modules page for details about loading input module scenes. To install this input module via its pre-built scene:

  1. Attach the HoverSceneLoader component to an object.
    1. For the "Scene Folder Path" and "Scene Name" properties, replace the "NAME" placeholder text with "Follow".
    2. To load the scene before runtime, click the "Reload Scene" button.

To install this module manually:

  1. Add a Camera to the scene.
  2. Attach the HoverInputFollow component to the camera object.
    1. Ensure that the "Look > Follow Transform" property is set to the camera's transform.

Component

Follow Component :camera: The HoverInputFollow component

  • The "Cursor Data Provider" property will automatically attempt to find the HoverCursorDataProvider component (in the HoverKit prefab).
  • The "Look > Follow Transform" property will automatically be set to Unity's current Camera.main.transform value.

Raycast Cursors

The "Look" cursor is almost always meant to be used with "Is Raycast" enabled. This allows interactions at a distance (a "laser-pointer" style of interaction) by projecting the cursor forward. This is particularly useful for VR/AR headsets which do not provide positional tracking or 3D input devices (like most mobile VR headsets), as it allows for interactions by simply looking at the desired item.