Search Unity

Working on AR project with multiple scenes

Discussion in 'Vuforia' started by frienddo, Jul 11, 2018.

  1. frienddo

    frienddo

    Joined:
    Jun 12, 2018
    Posts:
    5
    I have 3 scenes in my project:
    1. Vuforia with a pelvis as model target
    2. Vuforia with the same pelvis as model target
    3. No AR camera or model target, just a normal scene

    The problems I have are:
    1. When I'm previewing scene 3, the preview doesn't show the normal game objects in my world, but uses webcam and has the Vuforia watermark on the game preview. There's no AR camera in this scene.
    2. Even though scene 1 and scene 2 has the same model target, when previewing, only scene 1 can recognize the object, while scene 2 can't.
    3. In scene 1, after recognizing, the model's position becomes the camera origin's position, and is not tracked onto what the camera sees.

    https://imgur.com/a/88hVUnV <- pictures of 3 scenes.

    Please help. Thanks!
     
  2. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    It looks like you're using Unity 2017.3. In this version of Unity + Vuforia, Vuforia will activate automatically in all scenes once it has been enabled. The way to workaround this issue is to disable the VuforiaBehaviour in this scene. The easiest way to do this is to include the ARCamera in this scene and simply disable the Behaviour on the object, but you may also be able to do this programmatically when setting up the scene.

    This behaviour has changed in Unity 2018.1 and later with newer versions of Vuforia.

    Apologies for the inconvenience.
     
  3. frienddo

    frienddo

    Joined:
    Jun 12, 2018
    Posts:
    5
    Thanks for the reply! Do you have any idea why issue 2 & 3 are happening? Do you need more information?
     
  4. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Not sure about the second issue. If it's the exact same model target and isn't working in one scene, make sure you didn't miss a step in setting it up properly. Also make sure you aren't unloading or de-activating the dataset before entering the scene it doesn't work in. Do you see any relevant log lines when you enter the scene it doesn't work in?

    For the third issue, are you saying the model target is becoming 0,0,0, i.e. the world center? If this is the case, you can modify the world center mode on the ARCamera object to set it to be something else. If this isn't what you mean, I'll need more info here to understand what your issue is.
     
  5. frienddo

    frienddo

    Joined:
    Jun 12, 2018
    Posts:
    5
    I think I fixed it by using this same data set in an entirely new scene. I don't know why that fixed it, but it did.