Search Unity

Wrong behaviour of camera as a child in gameobject

Discussion in 'AR/VR (XR) Discussion' started by Pharaoh35, Nov 20, 2018.

  1. Pharaoh35

    Pharaoh35

    Joined:
    Dec 25, 2012
    Posts:
    57
    Hi everybody, I have a task to rotate camera which located in gameobject. When camera rotation has x0 y0 z0 everything works perfect, but when I set i.e. z to 90 and trying to rotate my gameobject along Y axis, I have X rotation of camera instead, it not happens when I use gameobject in gameobject, but camera in gameobject has such strange behaviour. Please help me to solve this task.

    As you can see at the pictures, I have a camera with skyview in gameobject, when I set camera Z rotation to 90 and start moving gameobject along Y axis I want skybox camera moving along green arrows not red.



     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Since this is the XR forum, we might guess that you're using some sort of headset (though it'd be nice if you told us).

    In that case, the headset sets the local rotation of the main camera at runtime. Might that be the source of your confusion?
     
  3. Pharaoh35

    Pharaoh35

    Joined:
    Dec 25, 2012
    Posts:
    57
    Thank you for answer, This thing happened without headset, just native gameobject and camera.