Search Unity

Can't look up with free look camera while object its following is falling or moving fast

Discussion in 'Cinemachine' started by Bigfella69, Jul 8, 2020.

  1. Bigfella69

    Bigfella69

    Joined:
    Jul 6, 2020
    Posts:
    4
    Hey team, I'm having a problem with my free look camera. I have it all setup how I want it for camera control and player movement control etc. However I have just found a problem with not being able to look up or down while my character that it is set to follow is either falling or moving away from it at any decent speed. I'm making a 3rd person game that relies heavily on movement via grappling hooks to pull/swing the player forward, and it seems that when I'm grappling forward at an increased rate I loose the ability to look up and down as the free look camera tries to keep up. Left and right still seems fine, but it feels like the angle that I have to look up and down while I'm standing still or moving at a normal speed gets really narrow while the camera lags behind during the grapple pull. I have also noticed this when My character falls from a height where it seems my camera gets locked from looking any higher than the horizontal plane as the player falls and pulls the camera with him. Is this a setting that I'm missing or is there a problem with my code or something like a clock mismatch? I have a bit of animation stutter while I walk around at normal speed as well so I wouldn't be surprised if it was a problem with my code. Its a nice visual feature having the camera lag further behind while the player accelerates forward but it seems to be affecting my ability to look around properly. Any thoughts on this would be appreciated.

    Thanks in advance.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    What version of Cinemachine are you using?
     
  3. Bigfella69

    Bigfella69

    Joined:
    Jul 6, 2020
    Posts:
    4
    version 2.6.0
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    Ah yes, the FreeLook has a damping bypass implemented for the horizontal angle, but not for the vertical.

    Have you tried replacing the FreeLook with a simple vcam with FramingTransposer in Body and POV in Aim? For that combo, make sure to set this option in Framing Transposer:

    upload_2020-7-8_10-16-12.png
     
    Clunk47X1 and Bigfella69 like this.
  5. Bigfella69

    Bigfella69

    Joined:
    Jul 6, 2020
    Posts:
    4
    Thanks, that worked perfectly. problem solved. Edit. actually sorry just noticed the camera doesn't remain focused on the player with this setup. I think it is definitely free look camera that I need. It appears to do what I want so long as my player isn't going too fast. Is there a setting that can make the camera keep up a bit better and less like its on a bungy chord.
     
    Last edited: Jul 8, 2020
    MiraiTunga and Gregoryl like this.
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,411
    any news if FreeLook camera will one day work with fast moving objects?
     
  7. AerionXI

    AerionXI

    Joined:
    Jul 20, 2020
    Posts:
    482
    I'd like to know how to do this as well.
     
  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    The problem is because the damping allows the target to move away from the camera, and the camera never catches up so long as the target keeps moving. One possible solution would be to turn down the damping, or to make a custom script (or visual script) that scales down the FreeLook's Z damping when the target speed increases.
     
  9. silentpundit

    silentpundit

    Joined:
    May 2, 2020
    Posts:
    26
    @Gregoryl thanks for the info. I'm also making a game with a lot of fally/jumpy third person gameplay so would love to hear more about how to manipulate the FreeLook's z damping if possible. With Cinemachine being a package it's not obvious how to get in and manipulate it via script.
     
  10. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    In the CM samples there is a Scripting scene that illustrates how to get in and fiddle with the settings via script.