Search Unity

Bug 3rd Person Follow Body blends badly in StateDrivenCamera

Discussion in 'Cinemachine' started by einWikinger, Nov 19, 2020.

  1. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    97
    We've started to use the "3rd Person Follow" body to realise some aiming/shooting interactions of our character. All of our character cameras are managed by a StateDrivenCamera so it can blend between the cameras depending on the animation state of the model.

    We've observed a strange blending artifact in our 3rd person cameras now that happens when the state driven camera needs to blend into/out of a VCAM that has the "3rd Person Follow" body.

    I've submitted a repro case via bugreporter (case 1293875).
    Happens in 2.6.3 as well as 2.7.1 in Unity 2019.4.8 and 2020.1.7

    Video in attachment:.2020-11-19 16-47-47.zip
     

    Attached Files:

  2. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Thank you for reporting the bug! We'll get back to you as soon as possible.
     
    einWikinger likes this.
  3. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    I looked at your project. I saw the jitter in your demo. But, it is due to some setup issue. I don't know why, but your vcams had some strange children objects.

    I could not reproduce the jitter with a new clean state driven camera setup. I attached a state driven camera that I created in your setup. This does not jitter.

    Let me know if it helps.
     

    Attached Files:

  4. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    97
    Can you tell me which objects you mean? I've now gone through the scene and prefab and removed everything (objects with hide flags included) that were neither the StateDrivenCamera nor one of the three direct child camera objects, but the behaviour didn't change. I guess the cameras were FreeLook before and the script has been replaced on them as I found the rig childs there.

    I've imported the prefab from you package, set it up, but it isn't blending correctly as well! It's better (no longer moving across the scene) but aim and FOV just snap into place (see attached video).
     

    Attached Files:

  5. gaborkb

    gaborkb

    Unity Technologies

    Joined:
    Nov 7, 2019
    Posts:
    856
    Yes, that was it.

    For the FOV part, the problem is with 3rdPersonFollow. It sets referenceLookAt for its purposes to a far away target, but that messes with blends. We will add a fix for in a patch.
    For now, you can add the attached custom cinemachine extension script to your 3rdPersonFollow vcams, and it will fix the fov blend problem.

    Thanks for reporting the bug! ;)
     

    Attached Files:

    Gregoryl and einWikinger like this.
  6. einWikinger

    einWikinger

    Joined:
    Jul 30, 2013
    Posts:
    97
    Thanks, works like a charm!