Search Unity

Question Help Needed with Odd Camera Movement Between Transitions

Discussion in 'Cinemachine' started by Biersy, Jan 2, 2021.

  1. Biersy

    Biersy

    Joined:
    May 30, 2017
    Posts:
    5
    Hey there everyone,

    Let me start by saying this is a little bit of a long post, and I have tried my best to illustrate the concepts and the issues I am having as concisely as possible. If I left anything out that you think is crucial, I apologize, please feel free to ask for more gifs/ screenshots/ info. Thanks ahead.

    So here's the deal. I am trying to build a souls-like camera system where the player can switch between freelook camera and a locked-on view where the camera focuses on an enemy, with the camera behind the player and staying behind the player.

    I have the system set up with Playmaker in a way I like, by switching some functionalities in the controls and then the camera priorities to achieve this. But, there are some problems.

    That is locked on > non-locked on. There is some bumpiness.

    There are 2 issues I can identify,

    1. The free look camera locks into the position it was last in when leaving top priority - it would be optimal if I could somehow make sure the non locked on camera was aligned with the locked on camera while in locked on mode, so I get to avoid some jank when switching states.
    2. Even if the cameras are in more or less the same position, there is some jank that happens in the transition no matter what. Gifs below
    Examples of the two camera states : FreeLook - non locked on camera

    [Incase the previews break, here is a link to the gif]

    Examples of the two camera states : Locked On Camera

    [Incase the previews break, here is a link to the gif]

    ISSUE 1:

    I start in non locked on, then look towards World Right, then lock on to the cube-enemy. I then move towards the enemy, move to its right and unlock to switch camera views - resetting to the original orientation of the freelook camera when priority was switched. Ideally, I want the non lock on freelook camera to be looking where the last locked-on virtual camera was. Though in its current stat it kept its original orientation looking toward World Right

    [Incase the previews break, here is a link to the gif]

    ISSUE 2:

    I attempted a brute force fix to the original issue, which sort of works but reveals a secondary underlying issue with the base of the system ( i have run tests and determined that the brute force solution is not causing the second issue ).

    I start in locked on mode, then switch back to non-locked on mode which, despite the cameras being relatively close to the same position theres a weird loop / swirve that happens in the transition. I jump back and forth between modes a couple times to illustrate.


    [Incase the previews break, here is a link to the gif]

    I have fiddled around with different transitions between these cameras before and nothing seemed to fix it and had tried making this system with JUST single free look camera and ran into some issues. I am fine with redoing the system or giving more information if need be.

    Any help you fine people could offer would be appreciated.
     
  2. Biersy

    Biersy

    Joined:
    May 30, 2017
    Posts:
    5
    Fixed Issue 1 - there is an inherit position check box under each vcams Transitions dropdown. Thanks Cinemachine!! The second issue is still something I am trying to figure out... luckily that one has its gif working...
     
    Gregoryl likes this.
  3. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Could you send an images of your vcams?
     
    Gregoryl likes this.
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,730
    Yes please, can we see images of the inspectors of the vcams?