Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Drifting with Simple Follow with World Up

Discussion in 'Cinemachine' started by JRRReynolds, Jan 24, 2023.

  1. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    I stumbled upon a few Cinemachine threads where drifting would occur when no input was applied, especially with a simple follow with world up configuration. This thread https://forum.unity.com/threads/freelook-camera-drifting-in-build-only.975588/#post-7934278 seem to imply that the latest version of CM fixes the issues. However, even using the latest package (2.9.4) I am still getting drifting issues. The only problem is I can't consistently outline the steps needed to reproduce, I just go around and jump and flick my mouse/camera around for a good 5-10 minutes and lift my mouse off the pad...and eventually the camera just keeps spinning around the character. I can then control the camera with the mouse but as soon as I stop supplying input, it will continue to drift. The camera starts off fine and acts as expected so this doesn't seem to be intended behavior; it gradually changes after playing/rotating a bunch (using starter third person controller). Is a "lazy" orbit camera style only possible with World Space?

    For reference with the setup up below it usually drifts then stops when it centers on the target after a while.



    But I've also used the setup below and it will rotate indefinitely.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,238
    It sounds as though you have some kind of feedback going on. Can you show me your scene's hierarchy? It could be a parenting issue.
     
  3. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Sure - the minimal changes I can make to recreate the bug as well: 1) Import starter assets 3rd person, 2) Update CM, 3) Click on player follow camera and change it to Orbital Transposer + Simple Follow with World Up, Aim->HardLookAt, and assign LookAt to PlayerCameraRoot. Then it's a matter of time before it will start to drift after rotating my camera a bunch. The screenshots above were me just trying various ways to fix it. Per the thread I linked above I also had some similar behavior where it would drift when the angle was outside of the -10/10 of 0 and 180 until it reached its target goal.I have some video of the drift as well showing the rig moving with no input but not sure that would help diagnose the issue in any way.


    Edit: I also tried removing any changes to the CM Cam in the third person controller just in case it was fighting with it [Comment out CameraRotation()], which still didn't have an effect. It just seems to drift around the 4-5 minute mark of spam rotating my character over and over again while rotating my camera.
     
    Last edited: Jan 25, 2023
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,238
    Thanks for the description and repro steps. I tried creating a repro project by following your instructions, but I'm not getting any drift at all, even after several minutes. Is there some other step that you forgot to mention? Here is my vcam:

    upload_2023-1-26_6-59-7.png

    I'm using Unity 2021.3.16f1, CM 2.9.4, 3rdPerson starter assets 1.1.3.
    If you like, you can send me a repro project and I'll see if I can locate the issue.
     
  5. JRRReynolds

    JRRReynolds

    Joined:
    Oct 29, 2014
    Posts:
    192
    Sent over a link to your inbox. I also tried testing with the new Cinemachine 2.9.5 (included in the repro project) and the issue is still happening.
     
    Last edited: Jan 27, 2023
    Gregoryl likes this.