*UPDATE* : An improved version with Dead Reckoning was published here, along with all the latest Unity dev.
*UPDATE 2* : We are now integrating with VRTK, check more informations here.
*UPDATE 3* : More information is now available on the Github Wiki.
Guess what ? Our new Unity Plugin is out ! Even though it is mostly based on the previous version, we have added many practical features to help you get started quickly with as little dev as possible. Let go through the features 🙂
The first problem with the previous plugin, and in general when integrating VR Tracker is that you have to associate a Tag to an object in the game (a GameObject). This was done by setting the Tag UID in Unity VR Tracker script, then building the game.
This means you cannot change the Tag when playing if it is out of battery, and you have to build a new version with different UID for each player.
I agree, it quickly gets annoying. So we fixed that ! How ?
Check out IntroAssociation scene in the plugin. It is the first scene to run in a game. Here is how you should set your Build Settings :
A GameObject called VRTracker is a NetworkManager with a PlayerPrefab (here called VRTrackerPlayer).
If you have a look at the Player prefab you will discover that it includes child GameObject each with a VRTrackerTag script :
If you run the IntroAssociation scene, the game will check for VRTrackerTag scripts in the Player prefab and ask you, for each tracked object, to press the red button on the Tag (in real life, don’t look for a red button in Unity) corresponding to the GameObject.
All you have to do, is press the red button on the Tag when asked !
It doesn’t stop there 🙂 Once a Tag – GameObject association was performed using the button, it is saved in a file on the User’s device. Next time you start your game, it will look into that file and automatically associate your Tags to your GameObject, providing that the Tags are currently on the Network.
Another problem when developing games for VR Tracker is handling multiple users. So we decided to use Unity Networking and integrate it into the plugin.
For more informations on Unity Networking please have a look at :
You don’t have anything to do to integrate Player Networking, it is already in our Player prefab, but you can edit the prefab (remove the wand, or add another Tag etc…).
To Network the position of other objects, please have a look at Unity Tutorials.
Pickup and Select
If you check the script folder, you will see two scripts you have never seen before. Both are used in the VRTrackerPlayer prefab, in VRTracker_Wand –> Input
That script make use of extra Tag Button (more informations on adding a button the your Tag here), to select, drag and drop objects in your virtual environment. It can easily become a sandbox to create new environments in VR.
Here is an example where we use this script :
The Raycaster is based on Unity VR Samples (OSVR) to interact with objects in VR, called VRInteractiveItem
It can be used to select buttons in VR, sliders, objects, targets etc… Have a look at Unity VR Samples for a better understanding.
That ends the post, If you have any question, feel free to ask on the forum !