Reading Time: 2 minutes
Checked with: Unity 2018.3.10f1
The TrackedAlias prefab provides a way of attaching elements to Camera Rig configurations without specifically tying them to the underlying SDK Camera Rig.
This is useful if you want to support multiple SDK Camera Rigs in your scene but don’t want to duplicate the same child GameObjects of all the relevant SDK Camera Rigs.
SDK Camera Rig- A prefab from a specific 3rd party plugin (or SDK) that provides the basis for an XR Camera Rig setup (e.g. SteamVR or Oculus Integration).
Facade- A facade provides a user friendly interface into a more complex underlying system.
Expand the VRTK Prefabs Package directory in the Unity Project window until the
Packages -> VRTK Prefabs -> CameraRig -> TrackedAlias directory is visible then drag and drop the
TrackedAlias prefab into the Hierarchy window.
TrackedAlias GameObject in the Unity Hierarchy window then increase the
Camera Rigs -> Elements -> Size property by
1 (it will be
0 by default so change it to
1) on the
Tracked Alias Facade component
Drag and drop the
UnityXRCameraRig GameObject from the Unity Hierarchy window into the newly displayed
Element 0 field within the
Elements parameter on the
Tracked Alias Facade component.
Now you have a TrackedAlias in your scene that will track the first active valid Camera Rig that is set in the Camera Rigs list. At the moment there is only one Camera Rig set so it will only be tracking the UnityXRCameraRig.
You can now place other GameObjects in the TrackedAlias child GameObjects and they will follow the active SDK Camera Rig without being specifically tied to it.