# Distal interaction

To interact with distal elements, the user can use the raycast.

This feature is used the following way: the user inserts the hand in the FOV with an Open-Hand gesture. From the palm-center, the user will see a laser that will allow to aim at the object he/she can interact with. The reticle at the extremity of the laser allows to target and to refine the precision of the interaction. The pinch gesture activate the selection to manipulate the targeted object.

# Description

First and foremost, make sure to have QCHTAvatar prefab in your scene with the raycast system enabled.

# Physics Raycaster

To make a physic element raycastable, it requires:

The scene needs:

  • EventSystem

# Graphic Raycaster

To make a graphic element raycastable, it requires:

The scene needs:

  • EventSystem

# Event System and QCHT Input Module

Create an EventSystem by right-click > UI > EventSystem and replace the Standalone Input Module by the QCHT Input Module.

The Input Module (opens new window) receives and translates all the events into Unity Standards. It is the link between the user action and the system reaction. Raycasted elements respond to all callbacks which are Unity elements.

To allow the Raycaster System, drag and drop the left and right Raycaster into the Left/Right Ray Transform of the QCHT Input Module component. Then, enable Click On Down to send the event when the user is interacting. Activate Selection Grab to add the grab gesture for selection, in addition to the pinch. Finally, you can set the minimum pointer value in degrees to start dragging.

# RaycastDisplay

The QCHT Ray script into the hand prefab allows to customize different aspects of the raycast, such as its appearance (color, icon, size) and some parameters (laser bend ratio, speed).

  • Laser Activation Threshold : allows to define when to display the ray.
  • Laser Bend Activation Threshold : allows to define when to display the bend on the ray.
  • Laser Bend Ratio and Laser Bend Speed : allows to regulate the intensity and the velocity of the ray curve.