Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Bug Multiple cameras and their automatic positioning

Discussion in 'AR' started by bravey, Jun 2, 2017.

  1. bravey

    bravey

    Joined:
    Aug 17, 2014
    Posts:
    2
    Hi there,
    I have multiple cameras in a scene and I'd like to control which one is moved to follow tracking by Unity.
    At https://developer.microsoft.com/en-us/windows/mixed-reality/camera_in_unity it says that the MainCamera tag controls this, however I find that even Untagged cameras are being moved.
    To be specific, if I put two cameras without parents in a scene, one of them with the MainCamera tag, one Untagged, I expect the first camera to be moved along with the tracking and the second to stay still (i.e., its image being headlocked). That is what happens in the editor (using HoloToolkit's camera controls), but in the emulator and the HoloLens both cameras follow the tracking.
    Is this a bug or am I misunderstanding this?
     
  2. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Can you clarify what you mean by tracking by Unity?
     
  3. bravey

    bravey

    Joined:
    Aug 17, 2014
    Posts:
    2
    Sure, I was probably not using the proper terms.
    So here's my mental model, please correct me if I'm wrong:
    When the app starts on the HoloLens, Unity's coordinate system is initialized with the current head position and orientation as the origin and axis orientations, respectively. This coordinate system seems to stay fixed over the lifetime of the app. Movements of the HoloLens device are tracked and move the main camera (*) in Unity accordingly. Similarly, loading world anchors maps from real world locations (in some magic way) to positions and orientations in Unity.

    Except that the step marked (*) above seems to apply the device movements to every camera in the scene, not just the one tagged as main camera.
    So, for instance, if I place a second camera as a child under the main camera (trying to render a different layer such as an overlay), it does not stay affixed to the main camera by way of being a transform child, but instead it moves in an exaggerated way -- seemingly getting the device motions applied as its local transform again, so it adds up to twice the proper motion.
    To my understanding this shouldn't happen.
     
  4. Unity_Wesley

    Unity_Wesley

    Unity Technologies

    Joined:
    Sep 17, 2015
    Posts:
    558
    Interesting that is very strange, I will investigate the issue and see what turns up from the team.
     
  5. unity_andrewc

    unity_andrewc

    Unity Technologies

    Joined:
    Dec 14, 2015
    Posts:
    228
    Hi bravey - would you mind filing a bug with a repro project so we can take a closer look! (In the Unity editor, just go to Help and select the "Report a Bug..." option.) Thanks!
     
  6. walshy002000

    walshy002000

    Joined:
    Aug 11, 2016
    Posts:
    3
    Can confirm this is now happening remoting to a HoloLens 1 in 2019.2.12f1. Will file a bug report. Reproducible in new scene with the main camera for the HoloLens, and a second, separate, untagged, camera placed anywhere in the scene. Both camera's transforms are updated from the HoloLens, instead of the main camera.
     
  7. daniel_lochner

    daniel_lochner

    Joined:
    Jun 9, 2016
    Posts:
    175
    Hi, has this issue been fixed yet?
     
  8. mfuad

    mfuad

    Unity Technologies

    Joined:
    Jun 12, 2018
    Posts:
    335
    Hi @walshy0020000, if you filed a bug report can you share the case number so we can track status? @daniel_lochner feel free to file a bug if you're experiencing similar issues. If it's already a known issue or something we've fixed, the team will let you know.