Reset ar session

How to reset AR session.

1 Like

Do you mean restart AR application?

No, I mean reset everything like delete all detected ar plane and restart detecting new ar plane.

1 Like

I would also like to know this, as currently I can’t find a way to reset image tracking or plane detection without exiting and re-entering applications. Is there a way to reset the list of planes detected and the positioning of images detected?

1 Like

Why to the devs never respond to these kind of questions? You’d think they’d want people to create quality content for their devices, but it’s rare that any questions are actually answered or even acknowledged. We’re left in the dark and possibly producing buggy software

Hi. Create a script and attach it to the NRCameraRig and add this:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class ResetScene : MonoBehaviour
{
void Start()
{
print(“The Scene is Resetting”);
}
public void ResetSceneButton()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
}
}

Create a button. In the button attach the NRCameraRig, and at the Function->ResetScene->ResetSceneButton.
And done.
There are many people active on the Discord server :slight_smile:

1 Like

Thanks for your reply,
You are reloading the current scene, not resetting the session. I am asking about the session.
even doing this, you can see it’s never re-detect plane it only detect new area.

1 Like

Still I am looking for solution.

1 Like

Join in the Discord server and we’ll talk more there

Hi, sorry for late reply.
You can try to solve it in this way:

NRSessionManager.Instance.DestroySession();
NRSessionManager.Instance.DisableSession();NRSessionManager.Instance.StartSession();
NRSessionManager.Instance.ResumeSession();

1 Like

I had already applied these method.
When I call NRSessionManager.Instance.DestroySession(); method it destroy NRCameraRig and NRinputs gameobject.

NRSessionManager.Instance.DisableSession();NRSessionManager.Instance.StartSession();
NRSessionManager.Instance.ResumeSession(); these method are also not working.

1 Like

Be aware that if you do it this way, set variables during runtime are not reset!

1 Like

OK, then have you tried these methods?

TrackableImageSubsystem.Start/Stop
PlaneSubsystem.Start/Stop

Where do I find these methods?

Hello NrealDeveloper,

Any estimation update on this?

In the script of NRTrackableManager. Please try it.

This one doesn’t work, after restarting, the glass will still only detect planes in the new area, but it cannot detect planes in the previously detected area.

1 Like