Command or script to turn off camera on a scene

What’s the best way to turn off the camera on a scene which doesn’t need it? It seems to keep the camera on when it’s not needed (can see the IR lights).

The reason why I need this is that the player runs 24/7 onboard a cruise ship and the camera overheats when the camera is constantly tracking when it doesn’t need to be. Example, when no one is playing the game it returns to a menu screen but the camera is still on when it shouldn’t be.

There’s no possibility to turn on or turn off the camera in the current Nuitrack version, however, it’s expected that one working session is located between Nuitrack.Init and Nuitrack.Release. There’s an option to develop an app in a way that calling Nuitrack.Init and further creation of modules (Nuitrack startup) are triggered by an event that means “start of a new gaming session” and Nuitrack stopping (Nuitrack.Release) is triggered by an other event that means “stop of a gaming session”.

We have the same as olga said. When the game starts we start it manually through the init, and when going back to the main menu we use Nuitrack.Release. Sadly Nuitrack.release makes a pretty heavy lag spike.

Do you have an example of some code that you used?

There is not much to sample, whenever you want Nuitrack to start you call Nuitrack.Init(); And when you want it to close you call Nuitrack.Release();

For anyone who is as much of a noob at c# as I am, it’s simply:

using UnityEngine;
using UnityEngine.Events;
using nuitrack;

public class NuitrackManagerUnload : MonoBehaviour
{
void Start()
{
nuitrack.Nuitrack.Release();
}
}

and attach it to a gameobject in the scene you want the camera to turn off.

1 Like