---
title: "MR Interaction"
content_type: tutorial
url: "https://learn.unity.com/course/mr-functionality/tutorial/module-mr-interaction?language=en"
language: en
container_type: course
container_title: "MR Functionality"
container_url: "https://learn.unity.com/course/mr-functionality.md?language=en&version=2018.4"
standalone_markdown_url: "https://learn.unity.com/tutorial/module-mr-interaction.md?language=en&version=2018.4"
next_title: "Challenge — MR Interaction"
next_url: "https://learn.unity.com/course/mr-functionality/tutorial/challenge-mr-interaction-1?language=en&version=2018.4"
next_markdown_url: "https://learn.unity.com/course/mr-functionality/tutorial/challenge-mr-interaction-1.md?language=en&version=2018.4"
difficulty: beginner
duration_minutes: 30
unity_version:
  - "2018.4"
supported_unity_versions:
  - name: "2018.4"
    url: "https://learn.unity.com/course/mr-functionality/tutorial/module-mr-interaction.md?language=en&version=2018.4"
last_updated: "2026-08-04T14:24:51.000Z"
---

# MR Interaction

Discover the fundamentals of mixed reality interaction design for HoloLens in Unity.

This tutorial will teach you the basics of Mixed Reality interaction, specifically for the HoloLens headset.

## Overview

 This tutorial will teach you the basics of Mixed Reality interaction, specifically for the HoloLens headset.

To complete the tutorial, you’ll need to:

1. Set up your Scene for Mixed Reality development
2. Simulate HoloLens interaction in the Unity Editor
3. Configure Gaze and Gesture interactions
4. Configure Voice commands
5. Configure Move, Scale, and Rotate commands

## Set Up your Scene for Mixed Reality Development

_Apply Mixed Reality Scene Settings._

![MR Settings](https://connect-mediagw.unity.com/h1/20200316/learn/images/06d7d222-1bbe-4529-967c-b6a0bbd96f3c_2018_10_08_11_18_02__1_.gif)

1. Open the Mixed Reality Scene Settings window (**Mixed Reality Toolkit > Configure > Apply Mixed Reality Scene Settings**).
2. Check the boxes shown above and leave the others unchecked.
3. Hit **Apply**.

\--------------------

**What are Mixed Reality Scene Settings?**

**Mixed Reality Scene Settings** automatically set up your Scene to include the following:

- Mixed Reality Camera Prefab
- Reset Camera Position to Origin
- Add the Input Manager Prefab
- Add the Default Cursor Prefab

## Simulate HoloLens Interaction in the Unity Editor

_Gaze at the Cube using right click + mouse._

![Moving the view using right-click](https://connect-mediagw.unity.com/h1/20200316/learn/images/6e86054c-7a53-4a5c-bb0f-05bce076cc61_2018_10_08_11_21_22.gif)

_Use the arrow keys on your keyboard to move around._

![Moving around the Scene using the arrow keys](https://connect-mediagw.unity.com/h1/20200316/learn/images/e34f2a62-a55b-4028-ba30-029b08248fe8_2018_10_08_11_22_45.gif)

_Use the spacebar + mouse to simulate an air tap._

![Simulating an air tap using the spacebar](https://connect-mediagw.unity.com/h1/20200316/learn/images/4b53dcd6-af0e-4188-b38a-bf16c380e7d2_2018_10_08_11_24_07__1_.gif)

1. In **Play Mode**, right-click and move your mouse to gaze around the Scene.
2. Use the arrow keys to move around the Scene.
3. While gazing at the Cube, hold the spacebar and use your mouse to move the virtual hand. Click to simulate an air tap.

**Tip — Color Change**

Changing an object’s color is a simple way to ensure the core interaction mechanic is working and can save you lots of time in your development process. The color-changing functionality is already done for you on this Cube, but you will learn how to make these changes in the next section.

## Implement Pointer Interactions

_Add a Cylinder to the Scene and position it in front of the Camera and off to one side (opposite the Cube)._

![Adding a Cylinder](https://connect-mediagw.unity.com/h1/20200316/learn/images/7af5039e-60de-4b61-9ff6-f5a4a7093e35_2018_10_08_12_48_26.gif)

_Configure the OnPointerEnter event to change the Material using the Event Trigger component._

![Adding an Event Trigger](https://connect-mediagw.unity.com/h1/20200316/learn/images/eb583a59-b087-4894-8450-d6d06e89020d_2018_10_08_12_51_32.gif)

_Test it out!_

![Testing out the Event Trigger](https://connect-mediagw.unity.com/h1/20200316/learn/images/75076af9-d007-4d5a-93e4-83fbdc1ce8d5_2018_10_08_12_52_14.gif)

1. Create a **Cylinder** **GameObject** (**Create > 3D Object > Cylinder**).
2. Add the **Event Trigger** component to the object (**Add Component > Event Trigger**).
3. Add a new event to the **Event Trigger** by clicking on **Add New Event Type** and selecting **OnPointerEnter.**
4. Use the Selection window to select the Cylinder from **Scene Mesh Renderer > Material**.
5. Set the material to **Red Highlight.**

![Selecting the Cylinder](https://connect-mediagw.unity.com/h1/20200316/learn/images/b2e2a69e-f085-493e-ba9c-1889ebcae1ff_Screenshot__85_.png)

\--------------------

**Tip — Reference a working version**

Inside the Cube’s inspector, look at the Event Trigger component and note the specific events highlighted here:

![Using multiple Event Triggers to change the GameObject's Material](https://connect-mediagw.unity.com/h1/20200316/learn/images/4bdffd82-5029-4a05-8678-2401094a9b48_Unity_2018_10_08_11_30_42.png)

**What is an Event?**

An **Event** is triggered when a certain action happens in Unity. You can think of an event like a broadcast system. When the event is triggered, it's broadcasted to all GameObjects in your Scene. Any GameObject that's "interested" in the event can add actions (change Material, start animation, turn off, play audio, etc.)  to the event that get executed upon the event’s broadcast.

**What is an Event Trigger component?**

The **Event Trigger** can be used to specify functions you wish to be called for each Event System event. You can assign multiple functions to a single event and whenever the Event Trigger receives that event, it will call those functions.

## Add a Keyword to the Voice Manager

_Create an empty GameObject and name it VoiceManager._

![Adding an empty GameObject](https://connect-mediagw.unity.com/h1/20200316/learn/images/d9878be9-1650-4e7b-9546-4824c60768b6_2018_12_10_17_37_31__1_.png)

_Add a Speech Input Source component and add the “red” keyword to the keywords list._

![Adding the SpeechInputSource component.](https://connect-mediagw.unity.com/h1/20200316/learn/images/827a4c59-5368-4629-980c-2fe1e132a854_2018_12_10_17_38_15__1_.gif)

1. Create an empty GameObject (**Create > Empty GameObject**) and name it **VoiceManager**.
2. Add the Speech Input Source component by hitting **Add Component**, searching for, and selecting **Speech Input Source**.
3. In the Keywords drop-down hit the **+** button to add a new keyword — **red**.
4. Leave the **Key Shortcut** to **None** for now.

\--------------------

**What is a Speech Input Source?**

The **Speech Input Source** manages speech recognition on the HoloLens. This component is where you add keywords that will trigger an event when the system recognizes the word through the mic.

**Tip — Managers**

**Managers** are commonly used in Unity to delegate tasks and "manage" other GameObjects in your Scene. Common examples of managers include: GameManager, StateManager, VoiceManager, AudioManager, and AnimationManager.

**(Note:** By naming a GameObject "GameManager," you're not giving it special power. Naming is purely semantic.)

## Create a Voice Controlled Object

_Create a Capsule GameObject and name it VoiceControlledObject._

![Adding a Capsule](https://connect-mediagw.unity.com/h1/20200316/learn/images/82930ffe-17f3-447a-9b71-700e1f5cb0a8_2018_11_29_16_56_14.gif)

_Add a Speech Input Handler component and add the “red” keyword to the keywords list._

![Adding and configuring the Speech Input Handler](https://connect-mediagw.unity.com/h1/20200316/learn/images/f1d72058-5c30-4ecd-9d0f-34f5d3d385ac_2018_11_29_16_58_27.gif)

_Add a Material change to the Response event and make it turn red._

![Setting the Response Event](https://connect-mediagw.unity.com/h1/20200316/learn/images/44e021a2-9fc0-4cb5-a2da-61862bbc644c_2018_11_29_17_01_16.gif)

1. Create a Capsule GameObject, name it **VoiceCapsule**, and position it so that it's in front of the Camera (viewable in the Game view).
2. Add the **Speech Input Handler** to the GameObject by hitting **Add Component**, searching for the Speech Input Handler, and double-clicking to select it.
3. Add the **red** keyword that was declared in the Speech Input Source by hitting the **+** button and using the drop-down to select **red**.
4. Add a Response event by hitting the **+** button and dragging in the **VoiceCapsule** object.
5. Add the Material change to the Response event by using the drop-down to select Material (**MeshRenderer > Material**) and selecting the red highlight Material.

\--------------------

**What is a Speech Input Handler?**

The **Speech Input Handler** is used to add responses to the voice events declared in the Speech Input Source script.

## Add the Ability to Rotate and Scale

_Create another GameObject and name it RotateScaleObject. Position it in front of the Camera to illustrate rotate and scale._

![Adding the RotateScale object](https://connect-mediagw.unity.com/h1/20200409/learn/images/0ac83eec-74e9-4890-816d-a8c37804e33f_2018_11_29_17_02_55.gif)

_Add the Bounding Box Rig to the GameObject and configure the Bounding Box Prefab._

![Setting up the Bounding Box Rig component](https://connect-mediagw.unity.com/h1/20200409/learn/images/e3b06381-061f-4436-8897-d92a08bd2cb9_2018_11_29_17_05_04.gif)

1. Create a Cylinder (**Create > 3D Object > Cylinder**), name it **RotateScaleObject**, and position it in front of the Camera and to the opposite side of the **PointerCube** — (-2,0,8) works nicely.
2. Add the **Bounding Box Rig** to the Cylinder by hitting **Add Component** and searching for the **Bounding Box Rig**.
3. Find the **BoundingBoxBasic.prefab** (**Holotoolkit > UX > Prefabs > BoundingBoxes > BoundingBoxBasic.prefab**) in the Project view.
4. With **RotateScaleObject** selected, drag **BoundingBoxBasic.prefab** into the Bounding Box Prefab slot on the Bounding Box Rig component. It should look like this:

![Bounding Box Rig component](https://connect-mediagw.unity.com/h1/20200316/learn/images/2ec7c74f-ba87-4caf-9bf3-821ce2ad1423_Screen_Shot_2018_08_17_at_7.20.09_PM__1_.png)

## Key Takeaways

You now have a working knowledge of the core interaction techniques for the HoloLens and have successfully set up a Scene to work with those interactions.

By completing this tutorial, you've learned to:

1. Simulate HoloLens interaction in the Unity Editor
2. Configure Gaze interactions
3. Configure Gesture interactions
4. Configure Voice commands
