Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved MARS Device View

Discussion in 'Unity MARS' started by Tryll, May 11, 2021.

  1. Tryll

    Tryll

    Joined:
    Oct 16, 2015
    Posts:
    30
    I can't seem to get the MARS Device View to be navigable. In Simulation View or Game View I can navigate with WASD and right-click (like normal Unity), although game view is (by default) restricted to "head level" movement on the Y-Axis (unless it is unlocked.)

    But the Device View stays locked in place, even if I've launched the simulation with the toolbar "Play button". It doesn't respond to navigation input at all.

    ??

    FWIW, I'm only using simulated image markers in my simulation scene at this time.
     
  2. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    hello @Tryll,

    For moving in device view you have to keep pressed right click to move around and also press play, checkout: ezgif-3-fe1b4e9d4eba.gif
     
  3. Tryll

    Tryll

    Joined:
    Oct 16, 2015
    Posts:
    30
    I'm pretty comfortable with the right-click WASD approach, and use it all the time in Unity. Like I said, it works fine in Scene, Game, and Simulation views.

    I am setting my view modes for device view the same as the example you've provided, and I'm pressing play for the simulation.

    Still, the device view seems to be locked to viewing straight down the X-axis and does not allow any navigation. ??
     
  4. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    mmmm thats really strange. Lets try some things:

    You mentioned you are using a synthetic image marker (which should affect it), does it still happen on a new scene?.
    If you change the environment, does it still happen?

    If you create a new project, does it work?.

    Do you see any error logs in the Unity editor console?, how about on the OS editor log?
     
  5. Tryll

    Tryll

    Joined:
    Oct 16, 2015
    Posts:
    30
    Changing the simulated environment results in the device view using whatever camera position and orientation is baked into the scene - so not necessarily "straight down the X". BUT, the view remains unnavigable by keyboard and mouse.

    Creating a new scene with only a MARS session, has the same results as above.

    When I add the MARS session, it throws the following to the console:
    NullReferenceException: Object reference not set to an instance of an object
    Unity.MARS.Providers.IUsesCameraOffsetMethods.ApplyInverseOffsetToPose (Unity.MARS.Providers.IUsesCameraOffset obj, UnityEngine.Pose pose) (at Library/PackageCache/com.unity.mars@1.3.0/Interfaces/Subscribers/IUsesCameraOffset.cs:98)
    Unity.MARS.Data.Synthetic.SynthesizedPose.GetTraitData () (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/Backend/SynthesizedObject/Trait/SynthesizedPose.cs:25)
    Unity.MARS.Data.Synthetic.SynthesizedReferencePoint.GetData () (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/Backend/SynthesizedObject/Data/SynthesizedReferencePoint.cs:33)
    Unity.MARS.Data.Synthetic.SynthesizedTrackable`1[T].SafeAddTrackableData (System.Int32 dataID) (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/Backend/SynthesizedObject/Data/SynthesizedTrackable.cs:130)
    Unity.MARS.Data.Synthetic.SynthesizedTrackable`1[T].AddSynthData (System.Int32 dataID) (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/Backend/SynthesizedObject/Data/SynthesizedTrackable.cs:122)
    Unity.MARS.Data.Synthetic.SynthesizedObject.InitializeData () (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/Backend/SynthesizedObject/SynthesizedObject.cs:233)
    Unity.MARS.Data.Synthetic.SynthesizedObject.OnEnable () (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/Backend/SynthesizedObject/SynthesizedObject.cs:69)
    UnityEngine.MonoBehaviour:set_runInEditMode(Boolean)
    Unity.XRTools.Utils.MonoBehaviourExtensions:StartRunInEditMode(MonoBehaviour) (at Library/PackageCache/com.unity.xrtools.utils@1.3.0/Runtime/Extensions/MonoBehaviourExtensions.cs:18)
    UnityEditor.MARS.Simulation.SimulatedObjectsManager:AddSpawnedObjectToSimulation(GameObject)
    Unity.XRTools.Utils.GameObjectUtils:Instantiate(GameObject, Transform, Boolean) (at Library/PackageCache/com.unity.xrtools.utils@1.3.0/Runtime/GameObjectUtils.cs:69)
    Unity.MARS.MARSSession:EnsureSessionConfigured(MARSSession, UndoBlock, Transform) (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/MARSSession.cs:438)
    Unity.MARS.MARSSession:EnsureRuntimeState(Transform) (at Library/PackageCache/com.unity.mars@1.3.0/Runtime/Scripts/MARSSession.cs:247)
    Unity.MARS.CreateMenuItems:CreateMARSSessionObject(MenuCommand) (at Library/PackageCache/com.unity.mars@1.3.0/Editor/Scripts/Extensions/CreateMenuItems.cs:111)​
     
  6. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    And this happens also after closing and opening unity again, correct?.

    Are you able to reproduce this on an empty project?
     
  7. Tryll

    Tryll

    Joined:
    Oct 16, 2015
    Posts:
    30
    Creating a new scene after closing and relaunching Unity did not repeat the error that was logged to the console.

    But still the same locked-down Device View.

    After creating a new project, with only MARS installed, and adding a MARS session to the scene, the result is the same. No navigation in the Device View, no errors showing.

    Unity 2020 3.7f1 (But it has been the same in several base Unity versions.)

    Is there anything else which would exclusively affect the Device View's navigation?
     
  8. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    We are looking into this, what OS are you running, OSX or Windows?
     
  9. Tryll

    Tryll

    Joined:
    Oct 16, 2015
    Posts:
    30
    My dev system is OSX (Mojave)
     
    jmunozarUTech likes this.
  10. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Hello @Tryll

    We have managed to reproduce this issue on 2020.3.7+, Thanks for that!, good thing is this is already fixed on a patch release (1.3.1) coming out soon.

    Thanks for notifying us about this :)
     
  11. Tryll

    Tryll

    Joined:
    Oct 16, 2015
    Posts:
    30
    Excellent! I was sure I was missing something obvious.
     
    jmunozarUTech likes this.
  12. Till_LeFx

    Till_LeFx

    Joined:
    Dec 1, 2016
    Posts:
    9
    Two years later, I encountered the same bug, I guess.
    I am working with Unity 2022.3.4f1 (pro version) and MARS 1.5.0 on a Windows 10 platform.

    I followed every suggestion from @jmunozarUTech but nothing helps - navigation in device view is not possible. Do you have any tipps?

    UPDATE:
    tried Unity 2022.1.24f1 and 2022.2.2f1 - works (XR Interaction Toolkit 2.1.1)
    tried Unity 2022.2.21f1 and 2022.3.2 - not working (XR Interaction Toolkit 2.4.0)
     
    Last edited: Jul 10, 2023
  13. Jon_Huhn

    Jon_Huhn

    Joined:
    May 2, 2020
    Posts:
    11
    Same setup as Till_LeFx, and I can't navigate in Device view either. Above suggestions did not help.
     
  14. Jon_Huhn

    Jon_Huhn

    Joined:
    May 2, 2020
    Posts:
    11
    Found the workaround!!! First you right click as the documentation says, and while holding down the right mouse button, press and release the left mouse button. The while still holding down the right mouse button, you can interact in the Device View as expected.
     
    megede and Till_LeFx like this.