Reload unity scene with Nuitrack

Hello, I am using Nuitrack pro online version in my unity project. Now I want to reload my current scene in unity along with nuitrack. The code I am using to reload the scene is given below:

IEnumerator waitToLoadScene()
{
yield return new WaitForSeconds(5);
nuitrack.Nuitrack.Release();
yield return new WaitForSeconds(0.5f);
SceneManager.LoadScene(0);
}

But the problem is when I run this function, unity crash. And when I remove nuitrack.Nuitrack.Release(); and only load the scene, unity not respond and stuck at that point.
Can anyone please help me in this.

Hi Umang Mathur!
Thank you for your interest in Nuitrack.

Please provide us with the following information:

  1. Do you test in the Unity editor or in a compiled app?
  2. What is the target platform of the project (build)?
  3. Which version of Unity do you use?

It is worth noting that to stop Nuitrack, it is better to use the NuitrackManager method.StopNuitrack, this is correct and will not cause unexpected behavior.

Looking forward to your response.

Hello Eugene Vasiliev,

  1. Yes, I have test in unity editor.
  2. My target platform in windows.
  3. I am using Unity 2018.4.5f1

Hi Umang Mathur!

We want to make sure that you don’t reload a scene that has the NuitrackManager (NuitrackScripts) component present.
NuitrackScripts is not destroyed when the scene is reloaded (this is done intentionally), and if you reload the scene, a set of NuitrackScripts objects will be created and this will cause a conflict in NuitrackManager.

If this is the case, you can temporarily create an empty scene with the NuitrackScripts object, which you will load first, and then immediately load your target scene.

Looking forward to your response.