Search Unity

Use AR Camera (Vuforia.Core) in individual Scene, not entire project?

Discussion in 'Vuforia' started by vinnie-vivace, Oct 3, 2017.

  1. vinnie-vivace

    vinnie-vivace

    Joined:
    Jan 12, 2010
    Posts:
    35
    Probably being dense here, would not be the first time.

    Working with 2017.2.0f2 and have enabled Vuforia for my project, however I have certain scenes that have no AR requirements. Enabling Vuforia means every scene currently is setup (at runtime) with an ARCamera which is not desired.

    Suggestions on how to approach this would be appreciated.

    thanks.
     
  2. Augmenteer

    Augmenteer

    Joined:
    Aug 30, 2015
    Posts:
    43
    You should be able to simply disable the VuforiaBehavior component in those scenes.

    Let me poke our dev team - everyone's an Unite, so please excuse the delay
     
  3. vinnie-vivace

    vinnie-vivace

    Joined:
    Jan 12, 2010
    Posts:
    35
    Thanks. The point is, I do not have any Vuforia components in the scene, they get automatically attached to the mainCamera at runtime, which is not desired. I have hacked a solution where I clone the MainCamera gameobject on Awake, then onStart, Destroy the original mainCamera (with newly instanced Vuforia components) and replace it with my clone.
     
  4. Ark_Tarusov

    Ark_Tarusov

    Joined:
    Jun 24, 2016
    Posts:
    19
  5. whitebozo

    whitebozo

    Joined:
    Oct 27, 2014
    Posts:
    28
    So I gave a solution on how I got around this on Airy-Cat's post follow the link over to there to see how I implemented Vuforia into a multiplayer game where some players are AR cameras and some aren't there is even a Lobby scene that is in the project that doesn't have an AR camera on load.
     
  6. pdyxs

    pdyxs

    Joined:
    Sep 7, 2012
    Posts:
    6
    Another option seems to be to add a Vuforia behaviour to the camera in every scene, and disable it from the scenes that don't need it.

    @Augmenteer this feels like overreach by the Vuforia SDK - it's reasonable to assume that any AR project will have scenes that don't need AR, and so AR scenes should be opt-in rather than opt-out. Older versions of the SDK worked this way - you needed to add an AR camera explicitly in order to have AR functionality in a scene.
     
    AM-Dev and Railon23 like this.
  7. vinnie-vivace

    vinnie-vivace

    Joined:
    Jan 12, 2010
    Posts:
    35
    @pdyxs "overreach" is a good word, I agree and hope that Vuforia will reconsider this approach.
     
    AM-Dev, Railon23 and GoranRiddle like this.
  8. Augmenteer

    Augmenteer

    Joined:
    Aug 30, 2015
    Posts:
    43
    Thanks for the feedback. We've been discussing the same concerns with Unity.

    The behavior in 2017.2 is the result of Vuforia being integrated as an XR Device. That provides a lot of benefits, towards optimizations and the ability to integrate with other XR Devices. But it also results in Vuforia being enabled by default for each scene.

    While that's an appropriate assumption for an XR Device like Oculus or HoloLens, it's not appropriate for x-platform XR technology like Vuforia. So we're looking at alternatives and actively engaged w/ Unity engineering to improve this workflow - they're just as interested in getting things right.

    I'll keep you updated on our progress.
     
    raedan_group, Sylker, Dover8 and 2 others like this.
  9. vinnie-vivace

    vinnie-vivace

    Joined:
    Jan 12, 2010
    Posts:
    35
    thanks for the response, good to know we are on the same page and hopefully something that gets resolved soon. cheers.
     
    Vuforia-Strasza likes this.
  10. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    775
    WOW.

    I've just spent an entire day converting my project to 2017.2 Because Vuforia 6.2 was crashing on Android (IL2CPP). Now I find this. Vuforia enabled in every scene. And as a result, is crashing my game. And can't do a thing about it cause managed dll's

    So great. I have a submission due in 5 days and gotta deal with this crap.

    How did this happen? This is a MAJOR oversight. You seriously presumed that any app using Vuforia would be used in every aspect of the app? This is a complete fail. How did this pass QA? Didn't anyone test this? Amazing.
     
    Last edited: Oct 20, 2017
  11. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Hello CDF,

    I apologize for the issues you've been facing. As mentioned above, the following thread goes over steps to disable Vuforia in scenes in which it is not needed https://forum.unity.com/threads/do-not-run-vufory-when-the-application-starts.498351/. I hope that this method resolves your issues.

    I will be sure to express all of your concerns with this aspect of Vuforia to the rest of the team.

    Thanks and apologies for the inconveniences.
     
  12. megatonmedia

    megatonmedia

    Joined:
    May 9, 2015
    Posts:
    4
    CDF,

    At least the workaround is fairly easy. In the scenes you do not want Vuforia, add the Vuforia Behavior Component to a camera, then disable that Component. Then when you run the game, it will not inject Vuforia into that scene because Vuforia already exists and is disabled.

    There's more detailed info in the link posted by the Vuforia tech
     
    AM-Dev and nubhokage1991 like this.
  13. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    775
    I understand, and yes I have implemented that solution. However, on App start Users are getting hit with "Enable Camera Usage" permission, which doesn't make any sense at that point. + It's just really messy and annoying, especially if I just want to test out some things in a new scene. I keep forgetting to add the Vuforia Behaviour and disable, then suddenly see my face appearing the background of the scene because of the WebCam
     
  14. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    109
    I wrote a class NoARPlease that I add to a GameObject with the same name in every scene that does not require Vuforia's AR. Although the before mentioned workaround works for me, I personally prefer my approach for now, because the suggested workaround feels highly Vuforia implementation details dependent. The workaround with the disabled component might not work anymore when Vuforia slightly changes their implementation of the Vuforia injection code to ignore existing components on the Camera.

    I do hope that the Vuforia integration will change so that we no longer need to worry about this weird issue in non AR scenes.

    For now, I think my script is a safer way of undoing Vuforia's actions in your non AR scenes.

    Code (CSharp):
    1. public class NoARPlease : MonoBehaviour {
    2.  
    3.     // Use this for initialization
    4.     void Start () {
    5.  
    6.         Camera mainCamera = Camera.main;
    7.         if( mainCamera )
    8.         {
    9.             if( mainCamera.GetComponent<VuforiaBehaviour>( ) != null )
    10.             {
    11.                 mainCamera.GetComponent<VuforiaBehaviour>().enabled = false;
    12.             }
    13.             if( mainCamera.GetComponent<VideoBackgroundBehaviour>( ) != null )
    14.             {
    15.                 mainCamera.GetComponent<VideoBackgroundBehaviour>().enabled = false;
    16.             }
    17.             if( mainCamera.GetComponent<DefaultInitializationErrorHandler>( ) != null )
    18.             {
    19.                 mainCamera.GetComponent<DefaultInitializationErrorHandler>().enabled = false;
    20.             }
    21.  
    22.             //mainCamera.clearFlags = CameraClearFlags.Skybox;
    23.         }  
    24.     }
    25.    
    26. }
     

    Attached Files:

  15. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    theolagendijk likes this.
  16. yvrez

    yvrez

    Joined:
    Mar 7, 2010
    Posts:
    19
    theolagendijk likes this.
  17. Aga18011991

    Aga18011991

    Joined:
    Jun 6, 2017
    Posts:
    4
    Anyone knows how to go back from non AR scene to AR scene?
    This scripts works good when I want to switch from AR scene to non AR scene. That helps me a lot.
    But when I want to go to another scene (AR scene) - camera crash.
    This problem is only when I want to use OpticalSeeThrough option. Any other profile works fine.
    Please, any ideas? We have to finish our project soon, and after Vuforia's update all is crashed. Every day new problems..


    Code (CSharp):
    1. Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UnityEngine.MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
    2. Your script should either check if it is null or you should not destroy the object.
    3.   at (wrapper managed-to-native) UnityEngine.Camera:get_nearClipPlane ()
    4.   at Vuforia.DedicatedEyewearCameraConfiguration.UpdateProjection () [0x00000] in <filename unknown>:0
    5.   at Vuforia.DedicatedEyewearCameraConfiguration.ConfigureVideoBackground () [0x00000] in <filename unknown>:0
    6.  
     
  18. Aga18011991

    Aga18011991

    Joined:
    Jun 6, 2017
    Posts:
    4
    Ok, I fixed it.
    All is fine when I added script to ARCamera:

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using Vuforia;
    4.  
    5. public class DontDestroy : MonoBehaviour
    6. {
    7.  
    8.  
    9.     void Start()
    10.     {
    11. DontDestroyOnLoad (this.gameObject);
    12.  
    13.            
    14.         }
    15.     }
     
    auskak likes this.
  19. atorisa

    atorisa

    Joined:
    Dec 1, 2013
    Posts:
    129
    Any news?
     
    theolagendijk likes this.
  20. FontouraCollide

    FontouraCollide

    Joined:
    Nov 15, 2016
    Posts:
    11
    What the hell guys! This thread started at Oct 3, 2017!! And still nothing! Release a patch at least! Unity is broken!! HOW the hell did this pass QA???!
     
  21. CalebBarton

    CalebBarton

    Joined:
    Jun 24, 2017
    Posts:
    3
    I concur. 2017.3 released with no fix. This is a ridiculous problem, and is causing our project to simply keep using the legacy vuforia because of the problems it's creating.

    Can we at least please have an update if 2018.1 is going to fix anything?
     
  22. Marc-Uberstein

    Marc-Uberstein

    Joined:
    Apr 10, 2013
    Posts:
    8
    I made a little fix, but still with some extra effort.

    Just add "VuforiaBehaviour" Component to the Camera's you don't want as ARCamera, and the disable the Component (Uncheck the check mark).

    My code below should avoid auto ARCamera inits, and remove the existing "VuforiaBehaviour" Components to avoid the "It's not possible to have two ARCameras at the same time" error - and make it possible to spawn an ARCamera via developer request.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections.Generic;
    3. using UnityEngine.SceneManagement;
    4. using Vuforia;
    5.  
    6. public class FixARCameras : MonoBehaviour
    7. {
    8.     private List<Camera> _cameras = new List<Camera>();
    9.  
    10.     private VuforiaBehaviour _vuforiaBehaviour;
    11.  
    12.     private void OnEnable()
    13.     {
    14.         SceneManager.sceneLoaded += FixCameras;
    15.     }
    16.  
    17.     private void OnDisable()
    18.     {
    19.         SceneManager.sceneLoaded -= FixCameras;
    20.     }
    21.  
    22.     void FixCameras(Scene scene, LoadSceneMode mode)
    23.     {
    24.         _cameras.AddRange(Camera.allCameras);
    25.  
    26.         foreach (var c in _cameras)
    27.         {
    28.             _vuforiaBehaviour = c.GetComponent<VuforiaBehaviour>();
    29.  
    30.             if (_vuforiaBehaviour != null && !_vuforiaBehaviour.enabled)
    31.             {
    32.                 Destroy(_vuforiaBehaviour);
    33.             }
    34.  
    35.             _vuforiaBehaviour = null;
    36.         }
    37.  
    38.         _cameras.Clear();
    39.     }
    40. }
    41.  
     
  23. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    480
    @Augmenteer @Vuforia-Strasza I'm having an issue where Vuforia is tagging all my cameras as "MainCamera" - this is not desired, is there a way to turn it off?

    The main scene in our project doesn't use Vuforia so we don't need to add it to all the cameras (there's 3 cameras doing different things)

    Also how do we prevent Vuforia from requesting camera access from the user in a scene where Vuforia is not being used? Currently we ask the user in part of a design flow for onboarding the app, not at the start.

    Many thanks.
     
  24. hawken

    hawken

    Joined:
    Aug 22, 2013
    Posts:
    480
    Thanks for this, for stopping vuforia from tagging the cameras I added this at line 36:
    Code (csharp):
    1.  
    2. if (c.tag == "MainCamera" && c.name != "the name of my main camera")
    3.             {
    4.                 c.tag = "Untagged";
    5.             }
    6.  
     
  25. witteb

    witteb

    Joined:
    Feb 19, 2017
    Posts:
    13
    Maybe someone can help me get one of these workarounds to actually work. My AR scene works fine when run by itself - but when in my game I keep getting error cannot have two ar cameras at the same time. When my game loads I am loading all scenes at the start - I have set delayed unity - but when I enable my ar scene one of my cameras in the previous scene is getting turned into a vuforia camera. I have tried changing the tag of the camera - I’ve disabled the game object but keep hitting this issue. I’ve even tried the NoARPlease scrip and not using delayed start. Everything is fine until I initialize Vuforia - a camera in an inactive scene that isn’t enabled and isn’t tagged main camera keeps puking this error.

    Maybe I am just stupid but I have removed camera objects from every scene that does not need one (UI) stats etc so i have two scenes one is no ar geo scene and one is ar. My geo scene is main game scene and has two cameras so user can change between 2d and 3D perspective.

    I’ve tried adding the VuforiaBehavior and disabling on the cameras - that didn’t work. This is sooooo frustrating.
     
  26. caiovm

    caiovm

    Joined:
    Aug 9, 2012
    Posts:
    4
    Hello guys,

    My fellow colleague @CharlesBarros and I came up with a simpler way to prevent Vuforia to attach the unwanted VuforiaBehaviour to our innocent Cameras.

    The workaround does not demand more than attaching the component VuforiaCameraIssueFix to a GameObject in your first scene.

    It worked flawlessly for our project (we are using Unity 2017.3.0p2). It even fixed the "black screen" camera issue. We tested on Unity Editor, iOS and Android. I hope it helps you guys.

    Code (CSharp):
    1. using UnityEngine;
    2. using UnityEngine.Events;
    3. using UnityEngine.SceneManagement;
    4. using Vuforia;
    5. using System.Reflection;
    6. using System;
    7.  
    8. public class VuforiaCameraIssueFix : MonoBehaviour
    9. {
    10.     void Awake()
    11.     {
    12.         try
    13.         {
    14.             EventInfo evSceneLoaded = typeof(SceneManager).GetEvent("sceneLoaded");
    15.             Type tDelegate = evSceneLoaded.EventHandlerType;
    16.  
    17.             MethodInfo attachHandler = typeof(VuforiaRuntime).GetMethod("AttachVuforiaToMainCamera", BindingFlags.NonPublic | BindingFlags.Static);
    18.  
    19.             Delegate d = Delegate.CreateDelegate(tDelegate, attachHandler);
    20.             SceneManager.sceneLoaded -= d as UnityEngine.Events.UnityAction<Scene, LoadSceneMode>;
    21.         }
    22.         catch (Exception e)
    23.         {
    24.             Debug.LogWarning("Cant remove the AttachVuforiaToMainCamera action: " + e.ToString());
    25.         }
    26.     }
    27. }
    As you can notice we were forced to use reflection to unsubscribe the Vuforia's method AttachVuforiaToMainCamera from SceneManager.sceneLoaded, that was causing the problem.


    Cheers
     
  27. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    Thanks for sharing your solution @caiovm.

    This behaviour has been addressed for an upcoming Vuforia release. I'll share more details as I am able to.

    Thanks
     
  28. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    109
    Thanks @caiovm , works like a charm in our Unity 2017.3.1 project!
     
  29. gak2

    gak2

    Joined:
    Dec 8, 2014
    Posts:
    1
    CharlesBarros likes this.
  30. abenyei

    abenyei

    Joined:
    Oct 5, 2017
    Posts:
    1
    Hi,

    I've been following many of your posts and it's getting really frustrating trying to make two cameras work on one scene: one AR camera and one normal camera and try to change the camera during game.
    Could someone help me out? Is the Vuforia release with the fix coming any time soon?

    Edit: turns out that restarting Unity fixed the issue for now. I created one first scene with a start button and with @caiovm script. Then I launch a second scene with two cameras that I'll be using and toggling in game. Hopefully we'll have an official fix from Vuforia soon, because I can't submit this as it is...
     
    Last edited: Feb 23, 2018
    CharlesBarros likes this.
  31. kvvishwanathan

    kvvishwanathan

    Joined:
    Nov 26, 2016
    Posts:
    1
    Hi,

    Exception in callback: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> UnityEngine.MissingReferenceException: The object of type 'Camera' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Debug:LogError(Object)
    Vuforia.DelegateHelper:InvokeDelegate(Delegate, Object[])
    Vuforia.DelegateHelper:InvokeWithExceptionHandling(Action)
    Vuforia.VuforiaBehaviour:Update()


    I am Trying to switch between Non AR scene --> AR scene --> Non AR Scene and then back to AR scene.

    Moving from Non AR to AR scene works fine the first time. But it dosent work the second time.

    I have included the VuforiaCameraIssueFix on the Non Ar scene.

    Need help, I am not sure what I am missing, tried out various options.
     
  32. IRobb

    IRobb

    Joined:
    Apr 29, 2014
    Posts:
    15
    I have been with the same issue yesterday when using new Unity 2017.3 and vuforia 7. I have made this code that switches between main camera (a common one) and an ar camera. See previous states for running it. Just add component and set cameras. Call function for changing between one and another inside same scene.


    /// <summary>
    /// Virtual Camera. Switches between a main camera and an ar camera
    /// </summary>
    public class cVCamera : MonoBehaviour {
    public enum eCameraType { mCamera, vCamera }

    [SerializeField]
    [Tooltip("Main Camera in scene. None Vuforia Behaviour. Audio listener enabled")]
    private Camera mCamera;
    [SerializeField]
    [Tooltip("AR Camera in scene. VuforiaBehaviour disabled. Audio Listener disabled.")]
    private Camera vCamera;

    private VuforiaBehaviour vuforiaBehaviour;

    private VuforiaARController varc;
    public eCameraType cameraType { get; private set; }

    private Camera cCamera;
    private AudioListener asMCamera;
    private AudioListener asVCamera;

    private System.Action onCameraReady;

    // State before start:
    // mCamera is a typical camera without any Vuforia Behaviour. Audio listener enabled
    // vCamera is a Vuforia ARCamera with VuforiaBehaviour disabled. Audio Listener disabled
    private void Awake() {
    this.varc = VuforiaARController.Instance;

    this.cCamera = this.mCamera;
    this.cameraType = eCameraType.mCamera;

    this.asMCamera = this.mCamera.GetComponent<AudioListener>();
    this.asVCamera = this.vCamera.GetComponent<AudioListener>();

    this.vuforiaBehaviour = this.vCamera.GetComponent<VuforiaBehaviour>();
    }

    private void onVuforiaStarted() {
    this.varc.UnregisterVuforiaStartedCallback(this.onVuforiaStarted);
    this.onCameraReady();
    }

    /// <summary>
    /// Sets Main Camera or AR Camera. onCameraReady is called when finished
    /// </summary>
    /// <param name="onCameraReady"></param>
    /// <param name="cameraType"></param>
    public void setCamera(System.Action onCameraReady, eCameraType cameraType) {
    this.onCameraReady = onCameraReady;

    if (this.cameraType != cameraType) {
    this.cameraType = cameraType;

    if (this.cameraType == eCameraType.mCamera) {
    this.asVCamera.enabled = false;
    this.asMCamera.enabled = true;

    this.cCamera = this.mCamera;
    this.vuforiaBehaviour.enabled = false;

    this.onCameraReady();
    } else {
    this.varc.RegisterVuforiaStartedCallback(this.onVuforiaStarted);

    this.asMCamera.enabled = false;
    this.asVCamera.enabled = true;

    this.cCamera = this.vCamera;
    this.vuforiaBehaviour.enabled = true;
    }
    } else {
    this.onCameraReady();
    }
    }
    }




    Hope helps!
     
  33. kickassdj

    kickassdj

    Joined:
    Nov 23, 2014
    Posts:
    1
    This works!! great work. Thank you :)
     
  34. Ozone_ABN

    Ozone_ABN

    Joined:
    Jan 11, 2014
    Posts:
    12
    If you try to compile this for UWP/HoloLens, it will fail.

    To work on HoloLens, please replace
    Code (CSharp):
    1. Delegate d = Delegate.CreateDelegate(tDelegate, attachHandler);
    with this
    Code (CSharp):
    1. Delegate d = attachHandler.CreateDelegate(tDelegate);
    Regards
     
    Amin- and RafayAli like this.
  35. jason_sone

    jason_sone

    Joined:
    Jul 7, 2017
    Posts:
    8

    Thank you SO MUCH! You just saved me from a huge headache. I have an app that uses both Vuforia and ARKit, and without being able to disable the Vuforia camera, ARKit wouldn't work. Now, everything works perfectly!
     
  36. su9257

    su9257

    Joined:
    Jun 13, 2017
    Posts:
    16
    I think this is a very bad problem. Once you enter unity, vuforia will be automatically initialized, and it can't be stopped at all. The current version used is 2017.3.1 p4, because sometimes I don't use Vuforia at all, which will make Unity The slow start, the most serious problem is that I deleted all vuforia resources, but he can start! My God, this is a bit like a virus! Hope to fix this problem quickly, thank you very much~:confused::eek:o_O
     
  37. theolagendijk

    theolagendijk

    Joined:
    Nov 12, 2014
    Posts:
    109
    If you're not using Vuforia disable it in your project ; untoggle "Vuforia Augmented Reality" under Player Settings => XR Settings for your platform.
     
  38. su9257

    su9257

    Joined:
    Jun 13, 2017
    Posts:
    16
    Hello, thanks for your help, I still use Vuforia in some scenes, and delete all Vuforia resources under the editor, disable Vuforia Augmented Reality, but he will run, he is really a stubborn SDK:D, or hope This problem can be fixed as soon as possible
     
  39. MetroSlim

    MetroSlim

    Joined:
    Sep 10, 2017
    Posts:
    1

    Thank you soo much for your help, it save my day.
     
  40. augivision

    augivision

    Joined:
    Mar 27, 2018
    Posts:
    14
    This is really unacceptable. My project is being held up because Vuforia is overreaching. There should only be an AR Camera in the scene if we CHOOSE to put one there. The last thing anybody wants is having Vuforia invade their entire project. Your current method is way too invasive!

    I am unable to switch between my AR and VR modes because Vuforia has to stick their garbage where it doesn't belong.
     
    Last edited: Mar 30, 2018
  41. augivision

    augivision

    Joined:
    Mar 27, 2018
    Posts:
    14
    I managed to get my VR scenes to function thanks to your help. Thank you for posting your code! Very simple & clean!

    I am curious, however...

    ...Is it possible to ONLY disable Vuforia's Device Tracker and replace it with my own GyroscopeCameraController class?


    It would be nice if I could use the Image Recognition and the Camera Background, but replace their device tracker with my own. However, as far as I can tell from Vuforia's API, the Device Tracker is a protected class and I cannot add my own tracking option.

    Does anyone see a way around this?

    Code (CSharp):
    1. DeviceTracker.TRACKING_MODE = ????

    https://imgur.com/qmwa8Pi

    I tried to Stop the Device Tracker with:
    Code (CSharp):
    1. TrackerManager.Instance.GetTracker<DeviceTracker>().Stop();
    AND
    Code (CSharp):
    1. TrackerManager.Instance.DeinitTracker<DeviceTracker>();
    I guess I also want to also disable Image tracking when on an object during OnTrackingFound()

    The behavior I am trying to accomplish is:
    When a target is found, enable colliders and renderers as usual then have it remain active OnTrackingLost(). Then, I want to switch to my own CameraController.cs, disable all Vuforia Tracking and keep the camera background.

    The user will recognize a target then switch to a Handheld VR/AR experience, using Vuforia's camera background and my custom device tracking script or gyroscope camera controller.

    An example of this could be aiming your device at an image of a butterfly, then watch the butterfly fly off of the image in AR, but switch to VR with Camera Background OnTrackingLost() so you can aim your device in 360 degrees while the butterfly continues to fly around.

    I guess after 60-90 seconds, when the butterfly animation is complete, we could re-enable all of the Vuforia Tracking.


    https://library.vuforia.com/content...anager.html#a91bde11673f589ce2468c508f4fb0493



     
    Last edited: Mar 31, 2018
  42. Vuforia-Strasza

    Vuforia-Strasza

    Official Vuforia Employee Vuforia

    Joined:
    Jun 13, 2017
    Posts:
    548
    This has been changed in Unity 2018.1 with Vuforia 7.1. I'd recommend looking into this version if this is currently causing you issues.
     
  43. AkiraDennis

    AkiraDennis

    Joined:
    Jan 17, 2018
    Posts:
    7
    Hello guys, I have a problem with my VR AR project who has Vuforia enable in it scene. When i disable vuforia, I can move my VR camera without any problem. but when i enable it. it just do nothing. my goal is using markers for my object position controller in VR environment. I'm using GoogleVR SDK btw (Cardboard). Please help me with this problem.
     
  44. LostInTheMachine

    LostInTheMachine

    Joined:
    Aug 8, 2010
    Posts:
    48
    OK - so I've had to disable Vuforia in Android mode because ARCore is not yet supported. So ARCore is enabled and Vuforia is disabled. Vuforia is enabled in IOS.

    BUT

    Vuforia still adds a VuforiaBehaviour to my cameras, but I can't create a fix for this as the Vuforia namespace isn't even recognised in Android. WHY does this happen!

    Who thought this was a great idea?

    Updating to 2018.1 is not an option at this moment in time. Running on 2017.3.1p3.
     
  45. Pencilaz

    Pencilaz

    Joined:
    May 10, 2014
    Posts:
    11
    Thak you for sharing this , this is what i want thank you again .
     
  46. amirehwan21

    amirehwan21

    Joined:
    Jan 30, 2018
    Posts:
    2
    Hi! Thank you for your solution. But where to put this c# code? Sorry because I'm new in Unity. Can you please help me? TQ
     
  47. CharlesBarros

    CharlesBarros

    Joined:
    Nov 17, 2011
    Posts:
    61
    Simply drag this script over a GameObject in your first scene. :)
     
  48. amirehwan21

    amirehwan21

    Joined:
    Jan 30, 2018
    Posts:
    2
    Alright. Thank you! :)
     
  49. freedom667

    freedom667

    Joined:
    Sep 6, 2015
    Posts:
    378
    Vuforia Camera crashing because of your script
     
  50. arielfel

    arielfel

    Joined:
    Mar 19, 2018
    Posts:
    25