Get Started
Prerequisite to run the demo
Import SteamVR Plugin from Unity Asset Store.
Find the LaserInputModule component on EventSystem GameObject, choose platform VIVE_STEAM2 and click Setup Input Module. It might take a few seconds to set up. You can then choose the trigger action for the laser pointer.
Run the demo!
Setup From Scratch
Make sure SteamVR Plugin is imported.
Add [SteamVR] and [CameraRig] into your scene.
Drag UIKitPointer prefab in one of the Controllers under [CameraRig].
Add EventSystem in your scene, remove all the components on EventSystem and add Laser Input Module component.
On the LaserInputModule component, choose platform VIVE_STEAM2 and click Setup Input Module. It might take a few seconds to set up. You can then choose the trigger action for the laser pointer.
If you haven’t created an action set for Steam VR 2. Please select window > Steam VR Input in unity toolbar. And generate a set of Steam VR actions. Once you've generated the action set, you can select the action trigger on Laser Input Module.
Other Features
On UIKitPointer Prefab, you can tick Allow auto switch hand to change pointer when player clicks trigger on the other hand.
Use Player Prefab instead of [CameraRig]
Please take a look at VivePlayerDemo(SteamVR2).unity for a reference.
Setup Steps
Drag UIKitPointer in your scene.
Drag Player Prefab from Steam VR in your scene. In Player > InputModule GameObject, remove everything. Then add a Laser Input Module.
On the LaserInputModule component, choose platform VIVE_STEAM2 and click Setup Input Module. It will take a few seconds to set up.
Then choose the trigger action.
If you haven’t created an action set for Steam VR 2. Please select window > Steam VR Input in unity toolbar. And generate a set of Steam VR actions. Once you've generated the action set, you can select the action trigger on Laser Input Module.
Tick Setup HMD explicitly, and drag left hand, right hand, and VR camera correspondingly.
All done!