Search Unity

can i have the camera collider pull in fast but rotate smoothly?

Discussion in 'Cinemachine' started by zeropointblack, Dec 22, 2020.

  1. zeropointblack

    zeropointblack

    Joined:
    Jun 8, 2020
    Posts:
    197
    ideas for "lerping"/smoothing the camera collider on X and Y but keeping the super fast Z pull in (so camera doesnt clip through things), but stays moving smoothly?

    basically, i want "damp when occluded" to be instant, 0, but the other axes to slowly move around the player. (cake and eat it too kind of thing.)

    i have regular damping at 10, and other settings maxed out as well, but the camera still uncontrollably jumps around when not allowed to clip through objects. (damp when occluded at 0.) different settings dont seem to fix the problem. so im guessing its going to involve some more game objects and lerping...
     
  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Could you clarify the behaviour you are expecting? What kind of camera setup would you like to have (e.g. third person)?

    If you know a game that does the behaviour you are looking for, please include a video link. ;)
     
  3. zeropointblack

    zeropointblack

    Joined:
    Jun 8, 2020
    Posts:
    197
    uhh lol, id say just about every third person video game ive ever played.

    basically what is currently happening with the free look camera now, but without trying to PUSH so hard back out to where it thinks it wants to go. i think i can fix this horrid result but letting it pull in fast away from an obstacle, but only retract very slowly, and only move around very slowly as well. either with proper dampening controls or manual lerping of some kind.

    would this be a job for force camera position? or at that point am i just writing my own collider code?

    currently, for me, my third person camera is much too jerky when it collides with objects. its unusable. the only built in option which helps this problem is "the when occluded damping", but then you get clipping. is this the only solution available right now?
     
  4. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    We have a body behaviour specifically for third person games, called 3rd Person Follow. Have a look at 3rdPersonWithAimMode, AimingRig scenes in our examples.

    Yes, CinemachineCollider is the only generic collision extension. You may try 3rdPersonFollow, because this one has a special built-in collider.

    If neither of those fit your needs, then you may implement your own camera collision solution. To create your own collider extension, have a look at Gregory's answer here: https://forum.unity.com/threads/custom-cinemachine-collider-strategy.1024156/.