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. Dismiss Notice

Question Unity3D CinemachineFreeLook Flickering Issue

Discussion in 'Editor & General Support' started by m_yukadev, Jun 16, 2023.

  1. m_yukadev

    m_yukadev

    Joined:
    Jul 12, 2022
    Posts:
    5
    There is a lot of flickering when using CinemachineFreeLook and no matter what I did, I would appreciate if anyone who knows can help. What I've tried:
    • I set the dumping values to 0.
    • I tried all the Update Methods.
    • Since I move the player with rigidbody, I turned on interpolate.
    These were the priority in the videos I watched or in the forums I browsed, but none of them worked :/

    Here are the videos (I don't know how to post a video, If you click on it, it will be installed on your computer):

    https://cdn.discordapp.com/attachme...38568086/bandicam_2023-06-15_15-54-31-406.mp4

    https://cdn.discordapp.com/attachme...91080232/bandicam_2023-06-15_17-19-49-635.mp4

    upload_2023-6-16_20-56-44.png

    Thanks.
     
  2. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    It looks like FixedUpdate vs Update jitter, but I can't tell for sure from only the videos.

    You should have:
    • Brain in LateUpdate
    • Player has RigidBody, with interpolation on
    • vcam has player as target
    In your player controller, it's easy to destroy interpolation by moving the player incorrectly.
    • Only touch the RigidBody in FixedUpdate, never in Update
    • Do all movement using the correct API in RigidBody, don't modify the transform directly.
     
    m_yukadev likes this.
  3. m_yukadev

    m_yukadev

    Joined:
    Jul 12, 2022
    Posts:
    5
    If I'm not missing anything, I did everything you said before but still there is a jitter. I can send the project to you if you want.

    Thanks for reply. :)
     
  4. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    Yes, please send the project
     
  5. m_yukadev

    m_yukadev

    Joined:
    Jul 12, 2022
    Posts:
    5
    Last edited: Jun 21, 2023
  6. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    I can't download from that site. You can just zip up your project (delete the Library folder first, it's huge and Unity can regenerate it). If it's small enough, you can attach it here directly. You can also DM it to me.
     
  7. m_yukadev

    m_yukadev

    Joined:
    Jul 12, 2022
    Posts:
    5
    Sorry I didn't know rar file was posted here
     

    Attached Files:

  8. Gregoryl

    Gregoryl

    Unity Technologies

    Joined:
    Dec 22, 2016
    Posts:
    7,207
    Thanks. The problem is your TPSCam script. It's modifying the player's transform. It should not do this, because it interferes with the physics simulation, causing jitter.

    I would re-think your controller/camera architecture. Right now it's very confused. There should be one script to move and rotate the player, and it should do 100% of that work in FixedUpdate, using the correct Rigidbody API, never touching the transform. It should operate in 2 modes:
    1. Basic mode: player rotates only when moving, to face the direction of motion
    2. Combat mode: player always rotates to face camera forward (use the main camera for this).
    Your camera selector should only activate/deactivate the appropriate vcam and toggle the player controller's mode. No other rotation code is necessary. Get rid of the "Orientation" object, you don't need it.
     
    m_yukadev likes this.
  9. m_yukadev

    m_yukadev

    Joined:
    Jul 12, 2022
    Posts:
    5
    I will do what you say, thank you very much for the help.
     
    Gregoryl likes this.