Vive Focus Plus controllers review

How to fix controllers buttons not working and menu interactions with Vive Wave SDK 3.0 in Unity

I was porting our Unity game Hit Motion: Reloaded to the new Vive Wave SDK 3.0.2 so that to make it ready for launch on the Vive Focus Plus, when something made me panic: no button on the controllers was working! I wrote to HTC and in the end, I managed to someway solve the issue… so I am writing this post for everyone that may find him/herself in the same situation.

How to make controllers’ buttons to work in Unity with Vive Wave SDK 3.0?

The situation is this one: you have made your Vive Wave project, everything seems so fine and in the Editor the game works like a charm. Then you push it on your Vive Focus Plus, with a smile on your face… to discover that the controllers are just like two magic wands that are tracked perfectly, but no button seems to work.

So you open the Vive Wave SDK Samples, you look at the Controller6DofTest scene, and you see that your program is identical to that… and in fact, if you build that sample scene, it doesn’t work either.

So… what to do? Or, as Chinese people would say: 我们怎么办?

vive wave controllers button not working
Sounds good, doesn’t work. No matter what buttons you are going to press, no one of those labels will change color at runtime

I asked this to Tony Lin of HTC and he kindly pointed me towards the solution. This strange behavior is due to a new feature that HTC is introducing in the Vive Wave SDK, called “Auto Key Mapping”, that will be useful to create automatic mappings of button commands among all the Vive Wave headsets. To implement this great stuff, the SDK has been modified and in this new version, you are now required to call a new API about the input. As the release notes of the Vive Wave SDK report:

WVR_SetInputRequest MUST be invoked after WVR_Init otherwise the app can NOT receive any key events from WAVE SDK 3.0 and later. To see detail.

So, basically, you have to call at first WVR_Init and then WVR_SetInputRequest to make everything work. There is only one problem… where the heck should I to invoke those functions??

Because yes, we are in Unity, and that line is referred to the native C++ SDK. And in Unity, all the Wave initializations are usually not performed by hand…

Luckily, there is another sample scene that may help us and this scene is “Button_test”. Inside it, you can see a prefab called WaveVRButtons, that has attached to it a script called WaveVR_ButtonList. If you give a look to the code of WaveVR_ButtonList, you will notice that it actually calls WVR_SetInputRequest… and this will happen after the WVR_Init call that is instead performed by the main WaveVR prefab. So, this is the magic script that will call the above native API for us and will make everything work.

So, how to make everything to work again?

  1. Add an empty gameobject to the first scene of your experience;
  2. Add to this object the script WaveVR_ButtonList.You can find it in the Assets\WaveVR\Scripts folder;
  3. In the inspector, specify in this script what kind of buttons you want to be tracked for the dominant (usually, the right) and non-dominant (usually, the left) controllers;
  4. Enjoy your program working again;
  5. Thank Skarredghost giving him $1000.
vive wave controllers button not working
In this example, we’re telling the Vive Wave runtime that we want to just receive the Touchpad-clicked event for the left hand and both Touchpad and Trigger-clicked events for the right hand

This trick has been a life saver for me. Notice that you need to use this script only once at the beginning of the program, it doesn’t need to be in every scene that you have (unless you want to change the settings).

How to make the controllers point correctly at menu items in Vive Wave?

Bonus tip, for another thing that has driven me crazy for HitMotion: Reloaded. The Focus Plus controllers aimed at a button in the menu, but actually the system selected another button, usually the one that was above it. I was really puzzled… and from my tests at VEC 2019, I noticed that I was not the only one… no one had a clear idea of how using the menu of the application. It was trickyer using the menus than actually winning a level in the game!

These days, I have finally discovered the reason. By default, the Wave SDK uses a pointing mechanism called “Mouse”. This pointing mechanism works this way: you have the controllers casting a ray from them and on this ray, at 1 meter of distance from each controller, you have a little dot, called the “Pointer”. If the line of sight going from your eyes to the Pointer crosses a UI element, then that UI element is selected.

My face when I discovered how the default pointing mechanism of the Focus Plus works

Needless to say, this is a bit unusual. I’ve made people from Italy, US and China test this and no one was that good in casting imaginary rays from the eyes going towards an imaginary dot just to select something that should be in between.

Typical user of our game when he/she had to use the menu (Image from Know Your Meme)

To change this, you have just to change the pointing mechanism to “Beam”. The “Beam” mode will actually cast a ray from the controllers, and will select whatever the ray will intersect. This is far more standard and understandable. But… how to do that? Let me explain this to you:

  1. If you are using menus that interact with the controllers, you have already for sure added the InputModuleManager prefab to your scene. If not, add it;
  2. Select the prefab and in the Inspector, look at its WaveVR_InputModuleManager script;
  3. Check the Override System Settings box;
  4. Find the field “Raycast Mode” and select “Beam”;
  5. Be happy and see your users being able to use a menu again.
Vive Wave menus selection methods
With these two simple changes, your menus will be far more usable

Of course, this is only one of the possible approaches… here we are forcing this setting. The other possibility is to directly change the System Settings of the device.


I hope this little post will save some headaches to some Vive Wave devs… and if this has been the case for you, like and share this post!

(Header image by HTC)


Disclaimer: this blog contains advertisement and affiliate links to sustain itself. If you click on an affiliate link, I'll be very happy because I'll earn a small commission on your purchase. You can find my boring full disclosure here.

Releated

virtual reality hog awe europe

My experience at AWE Europe and a comparison with the US chapter

I’ve just come home after my trip to Vienna to attend AWE Europe. Many people asked me about my experience with the event and especially what are its differences with the US version, so I thought it could be worth writing a little post about it. AWE is one of the best XR events out […]

shiftall meganex superlight 8k review hands on

AWE EU – MeganeX Superlight 8K hands-on: impressive resolution but at a price

Yesterday was my first day at AWE Europe, and I tried some very interesting devices there. My first test was with MeganeX Superlight 8K, Shiftall’s new headset with a very high resolution in a very compact design. MeganeX Superlight 8K Just a brief history of the MeganeX Superlight 8K, before we delve into the real […]