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

playstation vr 2

The XR Week Peek (2024.03.26): Sony halts production of PSVR 2, Meta slashes the price of Quest 2, and more!

This has been the week of GDC and of the NVIDIA GTC, so we have a bit more pieces of news than the usual because there have been some interesting things announced there. Oh yes, also IEEE VR had its show. Actually, a lot of things happened for tech people in the US, which is […]

We need camera access to unleash the full potential of Mixed Reality

These days I’m carrying on some experiments with XR and other technologies. I had some wonderful ideas of Mixed Reality applications I would like to prototype, but most of them are impossible to do in this moment because of a decision that almost all VR/MR headset manufacturers have taken: preventing developers from accessing camera data. […]