Search Unity

Disabling Plane Detection in IOS Wrecks Tracking?

Discussion in 'Handheld AR' started by KISP, Nov 28, 2018.

  1. KISP

    KISP

    Joined:
    Sep 13, 2018
    Posts:
    29
    In my application, I wish to disable plane detection once the user places an object. On Android, I accomplished this easily by using the solution suggested by the developer tdmowrer here: https://forum.unity.com/threads/ar-foundation-pausing-resuming-tracking.563272/.

    In IOS however, this method is causing several problems. Firstly, when plane detection is either enabled or disabled, the screen goes completely black for a second.
    When the screen goes black, XCode will also log a couple of reports stating:
    Technique World tracking performance is being affected by resource constraints.
    When the camera feed comes back, the tracking is completely ruined. If I'm re-enabling plane detection, any previously detected planes will drift to the right and never stop. If I'm disabling plane detection, it moves any objects placed on the virtual plane (usually height <0) to a world height of 0 instead.

    The code I used to toggle the plane detection is as follows:
    Code (CSharp):
    1.     public void TogglePlaneDetection(bool enabled)
    2.     {
    3.         planeManager.enabled = enabled;
    4.     }
    Where planeManager is of the type ARPlaneManager.

    This may or may not be related, but I found that if I toggled the plane detection several times in succession, it eventually caused a memory crash.

    Is there another way I can disable plane detection on IOS? Additionally, how should I be handling the situation where the error
    Technique World tracking performance is being affected by resource constraints
    appears? IOS doesn't appear to be capable of recovering from this on its own.
     
  2. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    490
    This sounds like an issue which was fixed in the last release of the ARKit package. Which version of the package are you on?
     
  3. KISP

    KISP

    Joined:
    Sep 13, 2018
    Posts:
    29
    It appears I'm using 1.0.0 preview 18
     
  4. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    490
    Preview 18 hasn't been released yet. Is your project's manifest pointed at the staging server?
     
  5. KISP

    KISP

    Joined:
    Sep 13, 2018
    Posts:
    29
    Updating the package fixed this problem, thanks!
     
  6. KISP

    KISP

    Joined:
    Sep 13, 2018
    Posts:
    29
    Sorry, I was referring to ARFoundation version, not ARKit. I've updated to ARKit preview 17 and that's fixed it.
     
  7. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    490
    Ah, that makes sense. Glad it fixed it for you.