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

Jerky movment with NavMesh and Cinemachine Follow Camera

Discussion in 'Navigation' started by frogwise, Dec 11, 2017.

  1. frogwise

    frogwise

    Joined:
    Nov 27, 2009
    Posts:
    103
    This is always a problem for me with any kind of movement system. I recently converted my RTS style click-to-move boat to use NavMesh and a Nav Agent and I'm experiencing it again.

    With a Cinemachine Camera setup to follow my boat, there is jerkyness when the camera tries to follow the boat when it's moving. I know this is a FixedUpdate / Update / LateUpdate issue (as it always is) but I really don't have any options that would allow me to fix this it seams.

    The setup is as follows :

    • Parent gameobject for the boat has the Nav Agent on it and a Box Collider.
    • Child of that parent has the mesh of the boat on it.
    • Child of that mesh has a projectile on it that is a RigidBody that can shoot when triggered.

    So I know it has something to do with the fact that my entire hierarchy is not a RigidBody except that one projectile that is tagging along. The camera follow and the NavMesh must be getting confused.

    Any help would be appreciated!
     
  2. zeinging

    zeinging

    Joined:
    Jul 14, 2019
    Posts:
    2
    this seems to work for me.

    private void Update(){
    myAgent.updatePosition = false;
    }

    private void FixedUpdate(){
    myAgent.updatePosition = true;
    }
     
    joelbb likes this.
  3. shivu_98

    shivu_98

    Joined:
    Dec 13, 2016
    Posts:
    8
    Hey did you figure it out yet ? i am facing the same issue
     
  4. joelbb

    joelbb

    Joined:
    Sep 25, 2015
    Posts:
    3
    Worked for me too, you are a beast, but why is this?