You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Lawrence Wong edited this page Aug 25, 2017
·
8 revisions
This example shows how to build up the basic environment that can interact with Unity built-in UI component.
After opening a new scene, remove default Main Camera and add the ViveCameraRig prefab to setup a basic VR scene. This prefab simply include VR devices like HMD(Camera), controllers and trackers.
Add VivePointers prefab into the scene. This prefab contains 2 event raycasters that can interact with the UI elements.
Create an UI button in hierarchy.
Remove default event system object (Optional).
Select default canvas object.
Remove canvas scalar component (Optional).
Remove graphic raycaster component (Optional).
Set render mode to "World Space".
Click "Add Component" to add the CanvasRaycastTarget script.
Set rect transform on canvas and button to locate them into your VR camera's sight.
UGUI now catches events from your Vive controllers!
You can find the complete scene in Asset/HTC.UnityPlugin/ViveInputUtility/Examples/0.Tutorial