Search Unity

How to prevent changing camera position and fov in play mode?

Discussion in 'VR' started by ktw_unity, May 2, 2019.

  1. ktw_unity

    ktw_unity

    Joined:
    Dec 12, 2018
    Posts:
    2
    Hello

    I have a VR scene and It's played well in Windows Mixed Reality environment, but I'm in trouble with camera position.

    When i'm in play mode, Main camera's position (y and z) and Field of view values is changed.
    You can see the changes in attached picture.

    Before play mode
    Before Play.PNG

    In play mode
    After Play.PNG

    y position changed 0 to 1.65
    z position changed 0 to 0.0985
    fov changed 60 to 105

    And a next log popped up in Console
    "Windows Mixed Reality spatial locatability state changed to Active."

    My main camera prefab is from VR Samples of Unity technologies. This problem don't occur in standalone build with oculus, android build with cardboard.

    How can i prevent this changes?

    Thanks.
     
    Last edited: May 2, 2019
  2. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    I believe the behavior you're seeing is by design. We do this move because we are essentially moving the world to your head's position for things like the user's physical height and stuff. This will place the floor where it's supposed to be and all that.

    The workaround, if you really want your camera to stay exactly where you put it is to attach your camera as a child to a game object like an empty game object which does the trick. If you're still having issues, let me know but I think you're experiencing 'by design' behavior from what I understand of your description.
     
  3. ktw_unity

    ktw_unity

    Joined:
    Dec 12, 2018
    Posts:
    2
    Thanks for your reply!

    I understand the behavior is by design. And i will try trick you mentioned.

    But, Is there any options to disable or adjust it?
     
    dlanfranconi likes this.
  4. JasonCostanza

    JasonCostanza

    Unity Technologies

    Joined:
    May 23, 2017
    Posts:
    404
    I believe the only way to adjust it would be in the Windows Mixed Reality Portal, there should be a setting to control the player's height.
     
    ktw_unity likes this.