Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Getting Started꞉ Play Scene
On this page, you'll learn how to interact with items by manually moving a cursor via its transforms. This is useful for simulating the use of a 3D input device, like the Leap Motion Controller.
- Complete the Scene Setup, Checkbox Item, and Slider Item steps.
- Set the CheckboxItem and SliderItem transform positions so that they are at least 0.2 units in front of the cursors, and roughly 0.2 units above them. The goal here is to avoid immediate interactions (upon hitting play) between the items and the cursors.
- Hit "play" in Unity.
- Select the HoverKit/Cursors/LeftHand/LeftIndex object via the Unity inspector.
- Move LeftIndex (via transform) near to CheckboxItem.
- As the cursor approaches, notice CheckboxItem fill up with its "highlight" color.
- Once the "highlight" reaches 100%, notice CheckboxItem rapidly fill up with its "selection" color.
- Once the "selection" color reaches 100%, notice that CheckboxItem toggles to a new checkbox value, and glows briefly with its "flash" color.
- Move LeftIndex (via transform) near to the "handle" part of SliderItem.
- Once the "handle" part flashes, it stays "sticky-selected".
- As you move the cursor along the slider track, notice how the handle follows the slider, and the slider's value (and label) changes based upon its position.
- As you move the cursor away from the handle, notice how the CheckboxItem's "selection" color retreats.
- Once the "selection" color reaches 0%, the "sticky-selection" is released.
- Select the HoverKit/Cursors/Look object via the Unity inspector.
- Move and rotate Look (via transform). Note that Look is configured to be a "raycast" cursor.
- As the Look transform changes, notice how its ray does (or doesn't) collide with an item.
- Notice how the items behave as if the cursor is placed at the collision point between the item and the cursor's ray.