A universal rig for VR games that syncs settings across the camera from each platform’s SDK.
TBCameraRig uses Unity’s native VR integration while simultaneously exposing the platform-specific functionality of all the various SDKs
- The scene contains a
- At least one platform is enabled in the TBCore Settings menu
Create a camera in your scene. Add a
TBCameraRig script to it. That’s it! This is now your VR camera on whatever platform you’re on. Depending on your project, you may want to make a prefab out of it, or tag it as the Main Camera.
Get the TButt namespace to reference
TBCameraRig in your scripts. Access functions and values through
Whenever you want to change camera settings, change them in the inspector or on
TBCameraRig.instance in code. Its properties are named to match the properties in Unity’s standard Camera class:
|Near Clip Plane||
|Far Clip Plane||
|Use Occlusion Culling||
TBCameraRig.instance.backgroundColor = Color.black; TBCameraRig.instance.farClipPlane = 200;
Gets the Unity
AudioListener associated with the camera.
Heads-up: At runtime, any
AudioListener attached to the camera will be moved to a new GameObject that follows the camera’s position and rotation, so be careful to avoid assumptions that the
AudioListener component lives on the same GameObject as the
Camera component.. This works around compatibility issues with camera scale and popular audio spatializers.
Camera Object References
You can get the following references to active objects and transforms through
||Returns the VR camera.|
||Returns a transform positioned at the center of the player’s tracking volume.|
||Returns a transform that matches the camera’s position and orientation.|
||Returns the AudioListener following the camera’s position and orientation.|
Events for changes to most camera settings - such as changes to clear flags - can be subscribed to through