

Return Input.GetButton("VR_PrimaryButton_Right") Return Input.GetButton("VR_PrimaryButton_Left") If (XRSettings.loadedDeviceName = "daydream") Public static bool FireControlActive(Handedness hand) Private static float m_FireTriggerThreshold = 0.75f Using this setting, you can enable platform-specific settings such as choosing different inputs to drive user actions.

XRSettings.loadedDeviceName tells you which SDK is currently driving input. XRSettings.supportedDevices lists out the VR SDKs that were selected at build time. XRSettings provides global XR-related settings such as which VR SDKs are supported by your built application and which one specifically is active. Sometimes user experience concerns demand that you implement SDK-specific details. InputTracking also provides events that fire when a node is added or removed and when tracking on a node is lost or acquired. It also tells you the node type, whether or not the node is currently tracked, and gives you a uniqueID. XRNodeStates provide physical information such as position and rotation of a node. XRNode types include abstract representations such as Head, LeftHand, RightHand, TrackingReference (for example, Oculus Rift cameras or Vive Lighthouses), and several more. InputTracking.GetNodeStates() will give you a list of what we call XRNodeStates. If you need a greater understanding of specific devices, there are several handy tools in the InputTracking class.
Pano2vr to openvr driver#
Tracked Pose Driver is a nifty component that will drive a Transform’s position and rotation based on a VR device. You can read up on enabling VR and selecting SDKs for your build in Unity Documentation’s VR Overview. When targeting “Android” you must build separately for daydream and Oculus virtual reality SDKs. When targeting “PC, Mac, & Linux Standalone” you can build targeting both Oculus and OpenVR virtual reality SDKs. Sometimes you can target multiple SDKs with a single exe, and sometimes you must build separately. Under each build target platform, you must target the correct virtual reality SDK. You can read up on changing build target platforms on the Build Settings page in Unity Documentation.

If you’re targeting the Oculus Rift, for example, your build target platform should be “PC, Mac, & Linux Standalone.” If you are targeting Oculus Go, your build target platform should be “Android.” If you want to target both the Oculus Rift and Oculus Go, you will want to build once per each target platform. Depending on what devices your application is built for, you may have to change your build target platform and compile multiple times.
