I'm making an iOS app in Unity that uses ARKit. Because I don't have the AR Camera running at all times, I start and stop the PositionalDeviceTracker at certain points in my code. Something like this:
// I do initialize the trackers in code, in case the device doesn't support it (which I check before calling this) smartTerrain = TrackerManager.Instance.InitTracker<SmartTerrain>(); positionalDeviceTracker = TrackerManager.Instance.InitTracker<PositionalDeviceTracker>(); //.. User opens AR -> I start the necessary Trackers positionalDeviceTracker.Start(); smartTerrain.Start(); // .. User interacts, everything works // .. Then user quits AR -> I stop the trackers: smartTerrain.Stop(); positionalDeviceTracker.Stop();
The first time everything works fine. However, the second time the user opens AR, I get the beautifully useless error: 'Could not start tracker'. Does anyone have an idea what could be going wrong here? In the Unity Editor this all works (which ofc isn't saying all that much..).
I use practically the same logic for the ObjectTracker (I also use Image Targets), which works like a charm.
Thanks in advance!