0
votes

I am having an issue regarding unity scene loading from assetbundle. I have created a scene with vuforia ARCamera and few image targets. I converted that to an assetbundle. Till now is fine but when I'm importing and loading the scene, it is showing a black scene without showing the AR camera but the image target is detecting the marker and showing the result on the black screen. Is there any way to start the AR camera after loading the assetbundle scene?

Thanks in advance.

1

1 Answers

0
votes

Is there any way to start the AR camera after loading the assetbundle scene?

you can wait for a scene to load using SceneManager.sceneLoaded. Then when the scene is completely loaded you can instantiate/activate your AR camera.

// called first
void OnEnable()
{
    SceneManager.sceneLoaded += OnSceneLoaded;
}

// called second
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
    //Put the code to enable/instantiate your ARCamera here
}

do mind that this has to be called after you have completely loaded the assetbundle

More info on how the SceneManager works can be found in the SceneManager unity docs