Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  5. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  6. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  7. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

Problem with instant preview

Discussion in 'ARCore' started by dpacholczyk_unity, Apr 14, 2018.

  1. dpacholczyk_unity

    dpacholczyk_unity

    Joined:
    Apr 14, 2018
    Posts:
    1
    I'm not sure what is happening suddenly I lost possibility of using instant preview. When I click "play" i see white screen instead of preview from camera and when I pause it in the console I see

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. UnityEngine.XR.ARBackgroundRenderer.DisableARBackgroundRendering () (at C:/buildslave/unity/build/Runtime/AR/ScriptBindings/ARBackgroundRenderer.cs:172)
    3. UnityEngine.XR.ARBackgroundRenderer.set_mode (ARRenderMode value) (at C:/buildslave/unity/build/Runtime/AR/ScriptBindings/ARBackgroundRenderer.cs:109)
    4. GoogleARCore.ARCoreBackgroundRenderer.Disable () (at Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs:103)
    5. GoogleARCore.ARCoreBackgroundRenderer.OnDisable () (at Assets/GoogleARCore/SDK/Scripts/ARCoreBackgroundRenderer.cs:66)
    6.  
    Any ideas? Everything is in latest version
     
  2. Pauleta

    Pauleta

    Joined:
    Aug 8, 2013
    Posts:
    14
    I got the same problem when i switch to another project using ARCore and instant preview. Everything works fine until i switch a project. Instant preview turns white and don't connect with editor anymore.
     
    Last edited: Apr 17, 2018
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    441
    Same here on S8, Win10, Unity 2017.4.1f1. Apparently

    Code (CSharp):
    1. Texture backgroundTexture = Frame.CameraImage.Texture;
    is null. Any ideas how to solve this?
     
    Last edited: Apr 29, 2018
  4. RegisVe

    RegisVe

    Joined:
    Mar 2, 2018
    Posts:
    9
    Instant preview not working on MacBook Pro + S8
     
  5. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    441
    Thanks, I added my spec. Using Win10.
     
  6. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    316
    Last edited: Apr 29, 2018
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    441
  8. yaffa

    yaffa

    Joined:
    Nov 21, 2016
    Posts:
    22
    Try adding these lines to your code :

    Code (CSharp):
    1. #if UNITY_EDITOR
    2.     // Set up touch input propagation while using Instant Preview in the editor.
    3.     using Input = InstantPreviewInput;
    4. #endif

    It causes the null reference error to not crash the app. It just logs the error after quitting the app.
     
  9. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    441
    These lines are already in the HelloARController class of the GoogleARCore example unitypackage. Doesn't work.
     
  10. hofcsaba

    hofcsaba

    Joined:
    Jul 17, 2013
    Posts:
    3
    It seems like as of now it is a bug, they said it will be fixed in an upcoming release.
     
  11. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    441
    Who said that? Unity or Google?
     
  12. nynohu

    nynohu

    Joined:
    May 5, 2012
    Posts:
    3
    I got the same problem when running HelloAR with instant preview on my Samsung Galaxy S8 (SM G950F, Android 8.0.0). Run on MacBook with Unity 2018.1.0f2 and ARCore 1.2.

    Screen shot when I run directly by touching the App's icon, not by instant preview.
     

    Attached Files:

  13. mraeclo

    mraeclo

    Joined:
    Dec 3, 2016
    Posts:
    6
    same problem here, but no error message, just a white screen

    same here, galaxy s9 running android 8.0.0, unity 2018.1.0f2, arcore 1.2.0, and instant preview 1.0.8
     
  14. nynohu

    nynohu

    Joined:
    May 5, 2012
    Posts:
    3
    I just found the reason of my case. Unity ARKit plugin affected some settings (I don't know what setting) and made issues for AR Core. If you run AR Core and ARKit in separate project, you will avoid that problem.
     
  15. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    36
    no one have a solution?
    i am stuck :(
     
  16. FUBAR2077

    FUBAR2077

    Joined:
    Nov 16, 2013
    Posts:
    8
    This is critical for the development, anyone has a workaround for this?