Arfoundation-samples: ARKit broken after loading new scene.

Created on 20 Jul 2019  路  14Comments  路  Source: Unity-Technologies/arfoundation-samples

Steps to reproduce:

  1. Open the "SimpleAR" sample scene.
  2. Add a button that triggers the code SceneManager.LoadScene("SimpleAR");
  3. Build and run the project.
  4. ARKit will run in the first loaded scene.
  5. After reloading the scene ARKit will not start.
  6. The button that triggers ARSession.Reset() will not work either.

ARKit will not start after loading any other ARFoundation sample scene. There are no errors in Xcode. The app does not crash. The app must be force quit in order to use ARKit again.

Device: iPad Mini 5
Unity: 2019.1.2f1
OS: iPadOS 13 Beta 3 + 4
ARFoundation: 2.2.0 preview.3
ARKit XR Plugin: 2.2.0 preview.3
ARFoundation Samples: 07/19/2019

Most helpful comment

I am having the same problem. If I reload a scene, switch scene or do any kind of scene changing, the AR Session does not start and the screen is turned black.

All 14 comments

Sounds like you're loading the same scene twice, which would give you duplicates of the ARSession and the AR managers. These are effectively singletons (though there's nothing preventing multiple instances).

Either unload the AR scene before loading another one, or have a separate scene that just controls the AR lifecycle and load/unload that to turn AR on and off.

ARKit will not start after loading any other ARFoundation sample scene.

SimpleAR was used and example, but going from SimpleAR to HumanSegmentationImages and back will have the same result.

This behavior was not present in 2.2.0 preview.1

The same behavior happens when loading a scene like SimpleAR, then loading another scene with no ARSession, then loading SimpleAR or any other example scene again.

It's not loading the scene additively so there should only be one ARSession per scene.

I am having the same problem. If I reload a scene, switch scene or do any kind of scene changing, the AR Session does not start and the screen is turned black.

This issue is still present in:

ARKit XR Plugin 2.2.0 preview.4
AR Foundation 2.2.0 preview.3
ARKit Face Tracking 1.1.0 preview.4

Rolling back to:

ARKit XR Plugin 2.2.0 preview.1
AR Foundation 2.2.0 preview.2
ARKit Face Tracking 1.1.0 preview.1

Works as expected.

This bug seems like a showstopper for any games with more than one scene. Are there any other suggestions?

I can also confirm this bug. I have a loader scene that loads the AR scene when the AR scene is done, I unload the scene completely and load it again and the background is black. I am using 2019.2 and 2.2.0 ARFoundation, ARSubsystem, and ARCore. A fix would be much apprecaited.

Confirming, I have two AR scenes behavior as explained above. It worked with the previous ARFoundation preview with no problems.
@tdmowrer Have you guys pinpointed the issue?

I can confirm this behaviour.

Appears to be fixed in AR Foundation 3.0

Still have this bug with AR Fundation 3.0 for Android version !! Even if i go to one NON-AR scene (menu), and then go to a new AR scene ... i've got the black screen bug !!
Have you all resolve this issue with 3.O version of AR Fundation ?

@alto971 We have a known issue where switching between AR scenes in 2019.3 causes a black screen, but not going when going from a non-AR scene to an AR Scene. Could you provide the following details so we can investigate?

Device
OS
Unity Version
ARFoundation and AR Kit version

@MarioUnity i've been working on another ARFoundation project .. still the same behavior !
Menu Scene (non-AR) => AR SCene : OK => return to Menu: OK => got to another ARScene or the same ARScene: KO We see the camera (no black screen) but the AR experience is broken ...seems tracking is off but no error in console.
(Unity 2019.4 + ARFoundation and ARCore XR plugin 4.0.8)

@MarioUnity i've been working on another ARFoundation project .. still the same behavior !
Menu Scene (non-AR) => AR SCene : OK => return to Menu: OK => got to another ARScene or the same ARScene: KO We see the camera (no black screen) but the AR experience is broken ...seems tracking is off but no error in console.
(Unity 2019.4 + ARFoundation and ARCore XR plugin 4.0.8)

@alto971 do you see this issue when switching between scenes in the AR Foundation Samples? We test switching between AR and non-AR scenes all the time and don't see a problem.

-Mike

@mdurand42 I'll test with 2 samples and a menu next week, and i'll tell you ! But when you're saying that you're not seing issues .. are you sure it's in the same cases as me ?
=> Menu Scene (non-AR) => AR SCene : OK => return to Menu: OK => got to another ARScene or the same ARScene: KO We see the camera (no black screen) but the AR experience is broken

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdrienMgm picture AdrienMgm  路  5Comments

KirillKuzyk picture KirillKuzyk  路  5Comments

jackpr-unity picture jackpr-unity  路  5Comments

rvegele picture rvegele  路  9Comments

ChakreyaYan picture ChakreyaYan  路  5Comments