Skip to main content

Recenter

How to recenter automatically on resume?

Scene reference

ParameterDescription
shouldRecenterUponApplicationResumeRecenter position and rotation if value is true
using JMRSDK;
using UnityEngine;

public class TrackingExample : MonoBehaviour
{
void OnEnable()
{
JMRTrackerManager.Instance.SetRecenterUponApplicationResume(true);
}
}

Recenter Actions​

How to use recenter action events​

JMRSystemActions.Instance.OnRecenterStart.AddListener(() => 
{
Debug.log("On Recenter Start");
});
JMRSystemActions.Instance.OnRecenterCancelled.AddListener(() => 
{
Debug.log("On Recenter Cancelled");
});
JMRSystemActions.Instance.OnRecenterEnd.AddListener(() => 
{
Debug.log("On Recenter End");
});

Recenter Head/Rig Function​

Exposed a function to recenter game scene anytime​

JMRTrackerManager.Instance.Recenter()