Giving life to object - scripting
Now let's get into the scripting part. We will be using C# language for the script. In this section, we will discuss the following interactions with holograms:
- Gaze: Highlighting and selecting objects
- Air Tap: Applying an action on the selected object
- Voice Command: Invoking an action through Voice Command
- Speech: Response back from the hologram
Highlighting the objects - enabling Gaze
In the previous chapter, we discussed different forms of input and interaction models for HoloLens. Gaze is one of the main forms of input on HoloLens, which indicates where the user is currently looking. With Gaze we will highlight the following two components of our holographic object:
- Lenses
- Speaker
The Gaze manager
Once the user gazes at an object, a cursor will indicate the gazed object. To enable the gaze and have a cursor in your scene, we will use components from the HoloToolkit.
Following are the steps:
- Add an Empty Game Object in the
Object Hierarchy
and rename itRoot.
- Go to...