Skip to content

SDK v0.9 [Deprecated]

Alex edited this page Mar 16, 2018 · 12 revisions

VR Tracker Unity SDK for tag version 1

1.Import the plugin asset

You have two choices to get the VR Tracker Plugin, download the files or use the VR Tracker Package. The VR Tracker folder contains the different sub-folders:

  • Plugins, contains the websocket library
  • Prefabs, contains some example prefabs
  • Scenes, you will have the assignment scene that will help you associate the tags to a user
  • Scripts, contains the different scripts that we provide to handle the communication with our system
  • VRSampleScenes, contains the environment of the IntroAssignation Scene
  • VRStandardAsset, contains some standard VR Assets that we use in our assignment scene

2.The IntroAssignation Scene

In the Scenes sub-folder, we have one scene called IntroAssignation. This contains the tag association routine and is one that needs to be used first before any other scene. IntroSceneExample

As your tracking tags are not assigned only the “Re-assign my Tags” option is displayed. By either using the mouse or if running a VR scene, look, at the “Re-assign my tags” and follow the routine.

3. Adding your own scene

On the IntroAssignation Scene, you will find a GameObject called VRTracker, which contains the UNET Network Manager. You will be able to see in the inspector the following information when clicking on it. (see Unity Tutorial) SceneAdded

After adding you own scene in the Build Settings, add it as the Online Scene in the Network Manager of the VRTracker GameObject, replacing the sample name of “_complete-game” as used in this example. This will the be the scene that is loaded after the tag assignment stage has completed.

4. The Player prefab

Inside the Prefabs folder is an example prefab so that you can see what the different important elements are when using UNET. (Unity Player Prefab) prefab example

You can see the different sections here that are important for Unity3D’s UNET.
prefab hierarchy You can directly use this prefab to test it with your own scene or create your own player prefab. For that take your player and add on it the following components:

For each physical object that you want to be tracked, you will need to add the VR Tracker Tag script Adding a tag to a user

In our case, you will need to add the script to the Player GameObject and the Gun GameObject. Don’t forget to add the camera to the player component. And on the game object that will contain the camera, add the Enable On Load script, this script will enable the player camera when the scene will be loaded.

6. Register the Player Prefab

Register the player prefab On the Spawn Info, select the player prefab that you have created as the Player Prefab. It will generate the different player avatar based on this prefab when connected. Now you can try the game with the new user prefab that you’ve created 😊.

You should now be good to go to use our system with this version of the plugin, enjoy!

Getting Started

Clone this wiki locally