Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Translating camera rotation correctly into quat from two different objects?

Discussion in 'General Discussion' started by Zebbi, Sep 5, 2019.

  1. Zebbi


    Jan 17, 2017
    For a first-person camera I'm controlling the x rotation of the camera directly, but I'm controlling the y rotation on a parent object that orbits the player at a distance, this way I don't have to rotate the player capsule collider and it's safer for collisions. I'm trying to translate this to second skybox camera that rotates the same way, but when I look up and down, the skybox tilts, and I think it's because the W angle is not correct when I combine the two different object angles. Is there some way of stopping this odd tilting?
  2. Antypodish


    Apr 29, 2014
    You really need to show us your exact setup of cameras.
    What is your GameObjects hierarchy related to cameras and which scripts are affecting cameras. Otherwise it can be so many things.

    My best bet is, you got angles/quaternions addition/ multiplications incorrectly.
    angrypenguin and frosted like this.
  3. angrypenguin


    Dec 29, 2011
    There's a fundamental misunderstanding here, because the components of a quaternion are not angles.

    If you're trying to do something in terms of angles then you can read out the (euler) angular components and use them to do what you need to do.