The Wave Controller package provides a lot of features that are already in legacy plugin (e.g. render model, button effect and controller tips). The Wave Controller package is installed by default when the Wave XR Plugin - Essence package is imported.
How to Import¶
In Unity, go to Project Settings -> Wave XR -> Essence.
The Controller package is located in Assets/Wave/Essence. There is a sample WaveControllerTest inside the Demo folder.
The Wave Controller has 3 functions: RenderModel, ButtonEffect and ShowIndicator.
This function loads the controller model from runtime based on the actual device connected.
Identifies which device to load.
Loads the specified model when the runtime can’t provide the controller model.
Wave Controller will show a different color when you press a button/key.
Identifies which device to monitor.
Enable button effect
If selected, the button effect will show when a key is pressed. This is enabled by default.
ShowIndicator is selected, the Wave Controller will show a button tip for every button.
How to Use¶
With Unity XR Plugin, you can use the controller through the Interaction toolkit or attach the Tracked Pose Driver component to the Wave Controller. Follow the steps below to attach the Tracked Pose Driver to the Wave Controller.
- Work with the Interaction toolkit
- Add XR Rig to the scene by clicking GameObject > XR > Room-Scale XR Rig.
- In XR Rig, choose the controller you want to apply with the Wave Controller.
- Plug the WaveController to the Model Prefab.
- Attach the Tracked Pose Driver component to the Wave Controller.
- Add the WaveController to the scene.
- Add the new Tracked Pose Driver component.
- Change Device to Generic XR Controller.
- Change Pose Source to Right Controller or Left Controller.
As the WaveLeftController and WaveRightController Prefabs have Render Model components attached to them, they will be destroyed when the controllers are disconnected from the headset. Avoid putting child objects under the Prefabs in the scene as the attached components may not be managed properly and may cause problems such as memory leak.
There is a sample that shows you how to use the Wave Controller with XRController inside the Demo folder.