O'Reilly logo

Virtual Reality Blueprints by John Williamson, Charles Palmer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating feedback for the user

When developing any type of user interface, it's important to provide a system to help guide the experience. In a virtual setting, this is even more important if the user's input method is a Gaze Input.

Without direct input (like a mouse and cursor), we need to create an indirect method which is just as effective. For this project, we'll use a visual glow to indicate when a selectable object is being gazed upon by the user. In the following code snippet, OnPointerEnter and OnPointerExit functions, provided by the EventSystem, will be our feedback mechanism. With these functions, we will add a highlight material and stroke to the selectable GameObject:

  1. Add the following functions after OnPreviewClick():
public ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required