Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Different vertical position of two (samey) free look cameras

Discussion in 'Cinemachine' started by BrandStone, Sep 5, 2018.

  1. BrandStone

    BrandStone

    Joined:
    Jul 21, 2014
    Posts:
    79
    I have two cameras during gameplay: one chase camera (field of view 60) and one aim camera (field of view 40). These are both Cinemachine Free Look cameras.

    The problem:
    If I look downwards and aim there's a big difference in Y offset (aim camera is significantly lower than the chase camera, and exactly the opposite happens then I look upwards).

    Example:

    Normal camera aiming at the top of the mountain:
    up_normal.jpg

    Then when aiming:
    up_aim.jpg
    What can it be to cause such a difference?

    Chase camera setup:

    chase_camera.jpg

    Aim camera setup:

    aim_camera.jpg

    Top, middle and bottom rigs are exactly the same for both of the cameras.
    What am I doing wrong?
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    You haven't shown the composer/transposer settings, but I'd guess that the camera isn't looking at the mountain, it's looking at the player's head. So when you move the camera's position closer, it will still try to look at the head, not at the mountain, and the mountain will shift on the screen due to parallax. The only way to get the mountain to not move is either to tell the vcam to look at it, or to move the vcam only along its Z axis.
     
  3. BrandStone

    BrandStone

    Joined:
    Jul 21, 2014
    Posts:
    79
    The camera is looking at player's origin (feet) but I adjusted the offset in the orbits zone / middle rig at 1,6 height (exactly on player's head). When aiming I use the CameraOffset plugin to move it just a little bit to the right but I also tested with it removed and it behaves the same.

    Here are the rigs for chase and aim:

    Chase
    chase_rigs.jpg

    Aim:
    aim_rigs.jpg
     
  4. BrandStone

    BrandStone

    Joined:
    Jul 21, 2014
    Posts:
    79
    Mistery solved! :)

    The problem comes from the difference in radius in the Orbits settings. Chase camera is set to 3 and aim camera to 1.
    I adjusted aim camera to 3 and decreased the field of view from 40 to 20.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,658
    Right, so it's like I said. The vcam is aiming relative to the head, so there is no reason for the mountain to remain fixed on the screen when you move the vcam, unless the mountain is at the same depth from the vcam as the head. It's parallax.

    The result you are seeking will not emerge naturally from a naive blend of 2 FreeLooks looking at the player. You need to take into account the Z axis of the camera when moving it. If you move the camera only along that axis without rotating it, then objects along that axis won't shift on the screen. Everything else will.

    EDIT: just saw your last. NOT moving the camera is a good solution :)
     
    Last edited: Sep 5, 2018
    BrandStone likes this.
  6. BrandStone

    BrandStone

    Joined:
    Jul 21, 2014
    Posts:
    79
    Yesss! :D no all is well and aiming is very precise!
    Thanks a lot for the help!