Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

(daydream)Gvr* working on editor but not in build versión

Discussion in 'AR/VR (XR) Discussion' started by ShadownHeart, Apr 12, 2017.

  1. ShadownHeart

    ShadownHeart

    Joined:
    Oct 8, 2015
    Posts:
    29
    Hi!
    While working in unity editor GvrController and GvrViewer function properly, but when I build the .apk on the mobile it doesn´t work. It is like it doesn´t dettect de funcitons. Anyone else got this problem ?

    Code example. In editor the game pauses and the sound is played, but while testing the build version on the mobile does nothing.
    Code (csharp):
    1. if (GvrController.ClickButton) {
    2.             SoundManager.playSFX (managerSounds.sounds[0]);
    3.             checkPause ();
    4.         }
     
    Last edited: Apr 12, 2017
  2. mira_leung

    mira_leung

    Official Google Employee

    Joined:
    May 17, 2016
    Posts:
    70
    The GvrViewer codepath runs only in-editor, and not on-device. GvrController should definitely be working - could you ensure that Daydream is enabled in Player Settings, and try to repro on the GVRDemo scene?
     
  3. FlorianBernard

    FlorianBernard

    Joined:
    Jun 9, 2015
    Posts:
    111
    Hello @mira_leung, I have the same kind of issue. My app works well in the editor with the Controller Emulator APK, but not when installed on device. I can't get the Daydream controller to be detected.

    I do have Daydream enabled in Player Settings.
    Using Unity 5.6.

    Any idea?
     
    Last edited: Apr 14, 2017
  4. ShadownHeart

    ShadownHeart

    Joined:
    Oct 8, 2015
    Posts:
    29
    Hi!
    I solved my issue. Debugging live on device with debugger-mode of MonoDevelopEditor I found that part of my code was throwing an error/crash. The code itself was ok, but probably the device couldn't handle/compatibility part of it.
    Hope it helps!
     
  5. Dfabula

    Dfabula

    Joined:
    Oct 21, 2015
    Posts:
    2
    could you tell me plesase in wich part of the code as the error please?
     
  6. ShadownHeart

    ShadownHeart

    Joined:
    Oct 8, 2015
    Posts:
    29
    The problem was within the SoundManager class, loading the music and sounds from a ScriptableObjects (as in the example code) causes an error on the device (That's what I think it was, I haven`t fully debugged the error yet).
     
unityunity