Search Unity

Damping 3rdPersonControllerWithAimMode at end of Value Range

Discussion in 'Cinemachine' started by OfficialHermie, Dec 19, 2021.

  1. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    Hello!

    I'm using 3rdPersonControllerWithAimMode example scene.

    I have made it so that the camera rotates around the player, but not all the way around it.
    So I have set

    Aim -> Horizontal Axis -> Value Range to -90 and 90 and deactivated Wrap.

    Now when I quickly move the mouse, the camera quickly rotates around the player, and it stops at the Value Range like a car that hits a wall: It's an instant stop. This looks very rough.

    I was expecting there would be the option to ease-out / damp the camera movement when it gets close to the value range end, but I have not found such an option.

    Does it not exist?

    Such a function is essential to get a smooth camera movement.

    Thank you for the help!

    Here is a video of RE4 that shows what I mean. I hope people can see it: At the end of the range, the camera movements is damped. Else it would look harsh:

     
    Last edited: Dec 19, 2021
  2. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    @Gregoryl Could you have a look? I don't see any option for that.
     
  3. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,711
    There is no option for that, unfortunately, but I agree that there should be.
    I will log a feature request.

    In the meantime, if you're in a hurry, you can work around this by making a custom input provider that scales down the input as the POV approaches the limit of its range. Do this by making a custom behaviour that implements Cinemachine.AxisState.IInputAxisProvider and adding that to your vcam.

    https://docs.unity3d.com/Packages/c...Cinemachine.AxisState.IInputAxisProvider.html
     
    Last edited: Dec 22, 2021
    OfficialHermie likes this.
  4. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    585
    I would prefer having a built-in solution. Thank you for your logging it.