Table of Contents

Ray Interaction

This interaction is used to do point and click with any of the platforms that VIROO supports:

  • XR with controllers: point with the controller and press the trigger button.
  • XR with hands: point with your hand and do the pinch gesture.
  • Desktop: aim with the mouse and press click.
  • CAVE: aim with the flystick and press the trigger button.

Add a Ray Interaction to a GameObject

To add ray interaction to an object you must:

  1. Configure the Interactable Object with the necessary components.
  2. Add the Actions you want the object to trigger.

Set up the Ray Interactable object

To make an object respond to a Ray interaction it must have, at least, the following components.

  • RayInteraction: VIROO Interaction System component.
  • Collider: a Collider set as Trigger must be added for this object to react to ray interactions.
RayInteraction
Field Description
Execute In Platforms On which platforms the action should be executed. Certain platforms can be excluded so that the action has no effect on them.
Actions The list of Actions that this interaction executes (see next item).
Highlight Cursor If checked the mouse cursor will change color when this object is hovered.

The GameObject must have the Layer RayInteraction set. This layer is automatically set when the RayInteraction component is added.

ray-interaction.png

Add Actions

At this point you can add the desired Actions for when interaction with the ray is performed by a user.

The Actions field of RayInteraction supports dragging the Actions triggered by this interaction. To see the Actions available in VIROO go to Actions and to see how to create your own actions go to Extend the Interaction System.

Add to the scene the Action you want to perform when this interaction occurs, in this example we will be using a MoveAction.

ray-interaction-move-action.png

And now, drag the MoveAction action to the Actions field of RayInteraction.

ray-interaction-actions.png