Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Bug Camera issue with Mars + AR Foundation

Discussion in 'Unity MARS' started by CreepyInpu, Jul 17, 2021.

  1. CreepyInpu

    CreepyInpu

    Joined:
    Oct 9, 2014
    Posts:
    23
    Hi !

    I'm looking to migrate an existing project that use AR Foundation without Mars.

    I've set up a new project (Unity 2021.1.4f1), and Mars is working fine.

    Now, on a new scene, I'm trying to make Mars and AR Foundation work together. This is an important step for me as my app is depending on using things like the ARRaycastManager, ARPlaneManager, ARAnchorManager, etc.

    So I just create an AR Session and AR Session Origin, and I add the Mars Session. On the Device view, everything's working fine. However in play mode, the camera seems to be stuck, and I can't move it like I do on the Device view. If I manually move up the camera on the Scene, it's still not working.

    The origin of the camera or any of it's parent is set properly to 0,0,0.

    Sans titre.png

    Am I missing something here ?

    I have some warnings like :

    No active UnityEngine.XR.ARSubsystems.XRSessionSubsystem is available. Please ensure that a valid loader configuration exists in the XR project settings.

    But from what I've read this is expected as I'm running the app in the editor.

    - Android build
    - AR Foundation 4.1.7
    - Mars 1.3.1
    - ARcore 4.1.7

    Thanks !
     
  2. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    296
    Hey there!,

    Could you check that you have activated the XR Subsystem by going to Edit -> Project Settings -> XR Plug-in Management and make sure the MARS Simulation checkbox is enabled?


    It is important to check that no other providers (checkboxes) are selected since when entering Play mode in the editor, Unity will use the first selected provider in the list.
     

    Attached Files:

  3. JonathanNUnity

    JonathanNUnity

    Unity Technologies

    Joined:
    Sep 27, 2016
    Posts:
    14
    Hi @CreepyInpu,

    Can you also check that you have 'Initialize XR on Startup' checked in Edit -> Project Settings -> XR Plug-in Management as well. If for you need to manage the XR startup for your app, we can work with you to further resolve the issue.
     
  4. CreepyInpu

    CreepyInpu

    Joined:
    Oct 9, 2014
    Posts:
    23
    Hi,

    Thanks both of you ! It seems to be working. I did not have "MARS Simulation" enabled. What was confusing for me is that this option is under the "Windows" tabs but my project is set on Android. On the Android tabs I have "ARcore" checked, is that correct ?
     
  5. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    194
    Yes, that's correct.
    It's a bit confusing since because simulation only works in the editor (and not on device) it only appears under the editor platforms in XR Plug-in management. So whether you're deploying to Android, iOS, UWP etc. simulation is accessible to you on your editor platform.
     
  6. CreepyInpu

    CreepyInpu

    Joined:
    Oct 9, 2014
    Posts:
    23
    Alright, I'll be careful now. Thanks a lot, and keep up the great work ;)
     
  7. CiaranWills

    CiaranWills

    Unity Technologies

    Joined:
    Apr 24, 2020
    Posts:
    194
    Unfortunately I can't access that video link, but to confirm: When you press the play button you can't move the camera using the right mouse button in the game view tab?