Search Unity

How to keep a AR version and a non AR version in the same project?

Discussion in 'Vuforia' started by SunnyChow, Apr 17, 2018.

  1. SunnyChow

    SunnyChow

    Joined:
    Jun 6, 2013
    Posts:
    360
    For some reason, we have to build a project for a AR version (for mobile) and a non AR version (for PC). As >90% of the content will remain the same, so we want to keep two version in just one unity project. But we get some problem when switching from AR to non-AR.

    If we keep "Vuforia Augmented Reality Support" in "XR Setting" on, it will automatically convert the main camera to AR camera. Even if we turn "Vuforia Augmented Reality Support" off, Unity returns errors because the Vuforia scripts are pointing namespace that doesn't exist. We acan manually remove the Vuforia files, but some of our scripts are interacting with Vuforia components, which makes the platform switching a trouble.

    So, do you have any suggestion for situation like that? Or should i use other method to deal with it , like git branching?
     
  2. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    117
    Have you seen this thread ; https://forum.unity.com/threads/use...n-individual-scene-not-entire-project.498489/

    A lot of developers ( me included ) faced the same issue, or similar issues coming from the same core problem. Vuforia assumes you're gonna need it's services in all of your scenes. Which in my experience is most often not the case.
    The thread mentions some workarounds for the issue. And Vuforia indicates somewhere that the issue will be resolved in a future version of the Vuforia SDK.
     
  3. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello @SunnyChow

    As @theolagendijk mentioned, that thread covers various solutions to it. The short version of how to get around this issue is to place the ARCamera in your scene and disable the VuforiaBehaviour script that is attached to it. You can also enable delayed initialization in the Vuforia Configuration.

    This behaviour is changing in Vuforia 7.1 which is available within Unity 2018.1.

    Thanks
     
    theolagendijk likes this.