Search Unity

Cutting between FreeLook and POV cameras while setting X Y axis without animation

Discussion in 'Cinemachine' started by rtilton1, Aug 9, 2019.

  1. rtilton1

    rtilton1

    Joined:
    Jan 4, 2017
    Posts:
    62
    Hi - I'm using Cinemachine freelook camera as my main camera for my 3rd person character controller game. I also need to add the ability to pop into a different POV camera. For this I've testing both a normal Unity Camera as well as a CM Virtual Camera (Hard lock to Target / POV) - same issue happens with both.

    My Cinemachine Brain - Default Blend is set to "Cut".

    When going from the freelook camera to the POV camera I set the position of the lookAt target of the POV camera in the same direction the freelook camera is looking. This works great. The POV camera starts in the orientation looking toward where the freelook camera was looking.

    When going from POV camera to freelook camera - to have the viewing angle match - I calculate what the
    m_XAxis.Value and m_YAxis.Value to get the correct position of the camera. The problem is there always seems to be a few frames where you see the camera changing to get into the correct position when I make the cut. I tried making the accel time and decel time for Y Axis and X Axis 0, but this didn't help. I also tried making the Body X,Y,Z Damping 0 in all the rigs (top, middle, bottom), but this didn't help. I also tried changing the CinemachineBrain Update Method - all 3 had the same issue...

    With all that debugging - what is the best way to change the heading of a freelook camera instantly (no lerping/damping/animation/etc). This is more than just updating the LookAt target, but I actually need to change where the camera is located within the rig rings.

    Any help would be greatly appreciated
     
  2. rtilton1

    rtilton1

    Joined:
    Jan 4, 2017
    Posts:
    62
    Was playing with the code and looks like trying to play with the accel and decel time actually solved it. Kept the freeLook camera on in the background when in POV and set accel and decel time to 0. Brought it back to .1f when back into the freelook camera....