Search Unity

Question Any changes to google cardboard implementation in the last 5 months?

Discussion in 'VR' started by lz7cjc, Oct 4, 2021.

  1. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Why not try the Recommended Release 2020.3 if you are starting a brand new project?
     
  3. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    ok - i copied over assets, plugins and project settings from my main project to your one... the 2d scene loads and i can move the scene by moving the phone. But when I highlight the enablevr button and tap it the app crashes
     

    Attached Files:

  4. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    I have tried on a POCO and motorola
    How can i send you the apk? it won't allow me on here
     
  5. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    dropbox or google drive shared link
     
  6. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    I tried that and got these errors:
    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(26,42): error CS0246: The type or namespace name 'WebViewEditorStaticWindow' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(14,23): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\Presenters\CollabHistoryPresenter.cs(21,9): error CS0246: The type or namespace name 'BuildAccess' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(19,39): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(28,27): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(12,9): error CS0246: The type or namespace name 'WebView' could not be found (are you missing a using directive or an assembly reference?)

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(28,35): error CS0115: 'CollabToolbarWindow.webView': no suitable method found to override

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(109,30): error CS0115: 'CollabToolbarWindow.OnEnable()': no suitable method found to override

    Library\PackageCache\com.unity.collab-proxy@1.10.2\Editor\Collaborate\Collab\CollabToolbarWindow.cs(26,69): error CS0535: 'CollabToolbarWindow' does not implement interface member 'IHasCustomMenu.AddItemsToMenu(GenericMenu)'


    also I use GVRreticlepointer and GVR editor and I seem to remember they weren't compatible with 2020 since you can no longer access legacy VR components - but that was a few months ago
     
  7. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
  8. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Is collecting strange errors nobody else stumble into, ever, part of a game?
     
  9. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    do i need all of these? if so that may be the problem
    I can't seem to install Google Cardboard XR plugin... I copied the link from github but it anchors to XR interaction subsystems and doesn't load v1.8.0 of the XR plugin
     
  10. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    oh - so what happens next? the game used to run fine the first time that you went into VR but now it doesn't even get that far! It is available on Google Play and called masterchange if you want to see what I am building
     
  11. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    ok that crashes here also when clicked vr button.

    full crash log attached, maybe relevant parts here, this error doesn't come up on my build:

     

    Attached Files:

  12. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    does that mean anything to you? i have no idea how to fix!
     
  13. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
  14. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    It looks nice. Don't think you need to keep anything from the old VR system any longer. Better to get rid of the old sdk code, and use the new XR system for all of it. The only thing you have to add yourself is the reticle. Just a forward ray to place a sprite on the hit position. (If its fine with just a gaze reticle.)
     
  15. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    I was missing one of the meta files and there was a line missing from maingradle - not sure how, as i copy/pasted the text from the set up instructions!

    So now your demo scene works in the new project. I did the same thing in my main project and it worked there as well! You are a genius, thank you so much for your patience and help in sorting this out ... it is an amazing end to the week.
    thank you
     
  16. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    thanks but now i have it working i don't want to rock the boat. I will bear it in mind for the future though
     
    arfish likes this.
  17. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,438
    nice!
     
  18. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    Hi... again - so after 1+ years of working well, this morning I tried to run my app in editor and got this error:

    Initializing XR Failed. Check Editor or Player log for details.
    UnityEngine.Debug:LogError (object)
    togglingXR/<StartXR>d__2:MoveNext () (at Assets/MyStuff/Scripts/using/togglingXR.cs:29)
    UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)

    the error is on the debug line
    Code (CSharp):
    1. if (XRGeneralSettings.Instance.Manager.activeLoader == null)
    2.         {
    3.             Debug.LogError("Initializing XR Failed. Check Editor or Player log for details.");
    4.             //new from other script
    5.             switchVRon = false;
    6.         }
    Nothing has changed. I ran the app in the editor and then stopped it. I then started it again and got this error. So I restarted the editor and now get this problem. Any ideas why this has suddenly surfaced and how to fix would be very welcome!

    thanks

    I am running v4.0.7 of XR plugin management
     
    Last edited: Jan 4, 2023
  19. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    Maybe you don't have any XRGeneralSettings.Instance.Manager.activeLoader running in the editor?
    Does it build, and run on the device?
     
  20. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    yes it does :) thanks, crisis over but how do i get it working in the editor again? It isn't realistic to build every time i want to check something

    any ideas? thanks
     
  21. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
  22. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    yes it is enabled. What I don't understand is why I got this error iterally 20 seconds after it was all fine. I stopped the game, and then started it and get this error. The error continues and hoping you might have some other ideas
    thanks
     
  23. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    782
    So, I checked my code, and it turns out that I was using #if !UNITY_EDITOR to prevent xr from being loaded. The camera is still on, so all important parts of the game can still be tested, just not in VR in the Editor.

    Found this tutorial for using Mock HMD for a stereo view in the Editor. Haven't tested it myself though.
     
    lz7cjc likes this.
  24. lz7cjc

    lz7cjc

    Joined:
    Sep 10, 2019
    Posts:
    540
    perfect thanks