Search Unity

Recentering to Target Heading Not Working as Expected?

Discussion in 'Cinemachine' started by Tyooo, Nov 4, 2019.

  1. Tyooo

    Tyooo

    Joined:
    Sep 21, 2018
    Posts:
    4
    I'm using CM as a 3rd person camera, with targeting and all. It works great, except that when I get in close, the camera takes a while to recenter. It obviously knows where to go - but my character moves faster than it can keep up, even with very small recentering times. I'm not really sure where to go from here. This is my first CM set-up so I might not be using the best cameras for the job, but any direction at all would be much-appreciated.

    Here's examples of the system at work. The third image shows what I mean - the guy in the bad samurai outfit is the player. If I stop moving the camera takes anywhere between 5 and 20 seconds to figure out where it's gotta be. To be clear, I'd like if the camera stayed more consistently behind the player.


    Thanks for any and all help with this.
     
    Last edited: Nov 4, 2019
  2. Tyooo

    Tyooo

    Joined:
    Sep 21, 2018
    Posts:
    4
    I made a video of how this is currently working. the 3rd person free camera is perfect, but the lock-on cam lags behind too much. Nothing I've done has so far made a difference.
     
    Last edited: Nov 6, 2019
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    It could be that you have a MaxSpeed in the X-Axis settings, which is limiting how fast the camera can orbit. Can you open up that section of the inspector and show it?

    In the latest version of CM, there is a new axis mode which might be helpful to you:

    upload_2019-11-7_9-44-8.png

    Setting that will eliminate the max speed and instead give you much more direct control over the orbit.
     
  4. Tyooo

    Tyooo

    Joined:
    Sep 21, 2018
    Posts:
    4
    Thanks for the response!

    I tried what you said, though it still doesn't work. I don't use an input axis to determine camera position - at least not for now. When the camera is locked, I want the camera to always point at the locked target from behind the player. I don’t think the player should need access to X- or Y-axis control for that, right?

    If the axis speed is supposed to work independently of axis input, though, I can confirm that’s not what’s happening in my project at least. Setting the speed arbitrarily high on either setting has no apparent effect with no input axis.
     
  5. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,724
    This is getting to be a little hard for me to follow. Could you throw together a small project with only the camera setup + 1 character and one enemy and DM it to me? Then I will be able to help you more efficiently.
     
  6. Tyooo

    Tyooo

    Joined:
    Sep 21, 2018
    Posts:
    4
    After some help from Gregoryl in DMs I was able to get the desired functionality. I wasn't able to totally ascertain the precise reason why my cams didn't work as I expected, thought it definitely has something to do with using the FreeLook camera, or at least how I was using it. I switched the lock-on cams to VirtualCameras and was able to work my way to achieving the desired functionality messing with the VirtualCamera's settings with the help of a test project Gregoryl made. Thanks again for your help!
     
    Gregoryl likes this.