Private & Confidential
Igloo VR Spectator Kit
If you have enjoyed using our VRSpectator Demo, you will be wanting to create your own experiences. Using our Unity Plugin you will be able to put VR Spectator capability into your own Unity projects.
How to Add to a Unity Project
Import the asset package into your Unity scene.
The only asset that is required in your scene is the IglooManager Prefab.
With the prefab placed in your scene, when the game is run settings are loaded which configure a custom camera system and optional player system to allow playback of your Unity project within an Igloo System.
IglooManager Prefab
The prefab is located in IglooToolkit\Resources\Prefabs
Drag the IglooManager prefab into your scene to the location the player should start.
At this point, you will need to adjust some values to enable this system to work as VR Spectator.
Setting up as VR Spectator
The first major adjustment is to place the VR Spectator IglooSettings.xml file into the root directory of your project. You will also need to place this into your built project.
It can be found in Resources/IglooResources/Settings/VR Spectator
This will make the Igloo system create 5 cameras that output a single NDI image across LAN, it will also not create an Igloo Player, and will instead look for a Follow Transform to follow instead.
This now means you need to add an object to follow to the Follow Transform slot in the Igloo Manager Component, this is dependant on your choice of VR Package.
For instance, If you are using Steam VR you will need to follow the VR Camera gameObject.
This does create a problem when you are using a VR package without a headset plugged in, as the steam VR system will revert to the NoVRFallbackObjects, so you will need to create your own script that looks for the active VR Object, I’ve included a sample script below.
[SerializeField] private Transform VRCamera;
[SerializeField] private Transform NonVRCamera;
[SerializeField] private Igloo.FollowObjectTransform followTransform;
public void Start()
{
// Look for the igloo follow object system
if(!followTransform)
{
followTransform = FindObjectOfType<Igloo.FollowObjectTransform>();
}
// Check for the VR Camera
if(!VRCamera)
{
try
{
VRCamera = GameObject.Find("VRCamera").transform;
}
catch(System.Exception e)
{
Debug.LogWarning(e);
}
}
// Check for the Non VR Camera
if(!NonVRCamera)
{
try
{
NonVRCamera = GameObject.Find("FallbackObjects").transform;
}
catch(System.Exception e)
{
Debug.LogWarning(e);
}
}
// Assign the current active in hierarchy object to the objectTransform.
if (VRCamera.gameObject.activeInHierarchy)
{
followTransform.objectTransform = VRCamera;
}
else if (NonVRCamera.gameObject.activeInHierarchy)
{
followTransform.objectTransform = NonVRCamera;
}
else
{
Debug.LogError("No VR Object is active");
}
}
// Not strictly necessary, but keep checking if the object that has been assigned is active.
void LateUpdate()
{
if (!followTransform.objectTransform.gameObject.activeInHierarchy)
{
if (VRCamera.gameObject.activeInHierarchy)
{
followTransform.objectTransform = VRCamera;
}
else if (NonVRCamera.gameObject.activeInHierarchy)
{
objectTransform = NonVRCamera;
}
else
{
Debug.LogError("No VR Object is active");
}
}
}
Related articles
(c) Igloo Vision 2020