Getting Started
VRTK requires a supported VR SDK to be imported into your Unity3d Project.
- Clone this repository
git clone https://github.com/thestonefox/VRTK.git. - Open
VRTKwithin Unity3d. - Add the
VRTK_SDKManagerscript to a GameObject in the scene.
VR Simulator
- Drag the
VRSimulatorCameraRigprefab from the VRTK/Prefabs into the
scene. - Select the GameObject with the
VRTK_SDKManagerscript attached
to it. - Select
Simulatorfor each of the SDK Choices. - Click the
Auto Populate Linked Objectsbutton to find the
relevant Linked Objects. - Use the Left Alt to switch between mouse look and move a hand.
- Press Tab to switch between left/right hands.
- Hold Left Shift to change from translation to rotation for the hands.
- Hold Left Crtl to switch between X/Y and X/Z axis.
- All above keys can be remapped using the inspector on the
VRSimulatorCameraRigprefab. - Button mapping for the VR control are as follows:
- Grip: Left mouse button
- Trigger: Right mouse button
- Touchpad Press: Q
- Button One: E
- Button Two: R
SteamVR Unity Asset
- Import the [SteamVR Plugin] from the Unity Asset Store.
- Drag the
[CameraRig]prefab from the SteamVR plugin into the
scene. - Check that
Virtual Reality Supportedis ticked in the
Edit -> Project Settings -> Playermenu. - Ensure that
OpenVRis added in theVirtual Reality SDKslist
in theEdit -> Project Settings -> Playermenu. - Select the GameObject with the
VRTK_SDKManagerscript attached
to it. - Select
Steam VRfor each of the SDK Choices. - Click the
Auto Populate Linked Objectsbutton to find the
relevant Linked Objects. - Optionally, browse the
Examplesscenes for example usage of the
scripts.
Oculus Utilities Unity Package
- Download the [Oculus Utilities] from the Oculus developer website.
- Import the
OculusUtilities.unitypackageinto the project. - Drag the
OVRCameraRigprefab from the Oculus package into the
scene. - Check that
Virtual Reality Supportedis ticked in the
Edit -> Project Settings -> Playermenu. - Ensure that
Oculusis added in theVirtual Reality SDKslist
in theEdit -> Project Settings -> Playermenu. - Select the GameObject with the
VRTK_SDKManagerscript attached
to it. - Select
Oculus VRfor each of the SDK Choices. - Click the
Auto Populate Linked Objectsbutton to find the
relevant Linked Objects.
Google VR SDK for Unity (experimental)
- Open a new or existing project in Unity (5.4.2f2-GVR13 or other version with Daydream integration).
- Import asset package GoogleVRForUnity you downloaded from Google.
- Build Settings:
- Target platform:
Android - Player settings:
- Virtual Reality Supported > Daydream
- API Level:
Nougat - Bundle Identifier and other settings for use with Android.
- In Hierarchy, create empty GameObject named
DaydreamCameraRig. - Move or create a Camera as child of
DaydreamCameraRig, reset its transformposition: 0,0,0. - Add
GvrControllerPointerprefab fromAssets/GoogleVR/Prefabs/UI. - Add
GvrControllerMainprefab fromAssets/GoogleVR/Prefabs/Controller/. - Add
GvrViewerMainprefab (enables view in editor play mode). - Disable Daydream's native pointer tools.
- Camera object, disable or remove GvrPointerPhysicsRaycaster component (if present).
- GvrControllerPointer/Laser, disable or delete.
Setup VRTK Components
- In Hierarchy, create an empty GameObject named
[VRTK]. - Add component
VRTK_SDKManager - Add a child empty GameObject named
RightController. -
Note: Daydream supports only one controller, LeftController will not be used. If present, can be disabled or deleted.
- SDK Selection
- In Inspector, choose Quick Select SDK: Daydream
- In Player Settings, ensure Scripting Define Symbols:
VRTK_SDK_DAYDREAM - Linked Objects:
- Click
Auto Populate Linked Objects, that should set:- Actual Boundaries:
DaydreamCameraRig - Actual Headset:
DaydreamCameraRig/Camera - Actual Left Controller:
empty - Actual Right Controller:
DaydreamCameraRig/GvrControllerPointer/Controller
- Actual Boundaries:
- Controler Aliases:
- Model Alias Left Controller:
empty - Model Alias Right Controller:
DaydreamCameraRig/GvrControllerPoints/Controller - Script Alias Left Controller:
empty - Script Alias Right Controller:
[VRTK]/RightController
Updated less than a minute ago
