May 2018
Beginner
492 pages
11h 53m
English
To be a functional dashboard, the buttons should operate when they're clicked. In Chapter 5, Handy Interactables, we explored the Unity Input system, including the "Fire1" event and other hand controller buttons. You may want to review that now. And choose which code snippet you want to use, if not the basic Input.GetButtonDown("Fire1").
The changes to make to the RespondToGaze.cs script are pretty simple. At top of the class, add the following public variables:
public bool clicker = true;public string inputButton = "Fire1";
At the bottom of Update(), make the following changes:
... if (isSelected) { if (highlight) button.Select(); if (clicker && InputGetButtonDown("Fire1")) button.onClick.Invoke(); ...Read now
Unlock full access