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’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

NavMeshAgent rotates on the spot at its destination instead of stopping

Discussion in 'AI & Navigation Previews' started by BenSizerRovio, Oct 9, 2017.

  1. BenSizerRovio

    BenSizerRovio

    Joined:
    Sep 25, 2017
    Posts:
    12
    As the subject title says, sometimes the NavMeshAgent reaches its destination, but then spins on the spot instead of stopping movement. I can presumably switch NavMeshAgent.updateRotation manually, but I don't think I should have to, so hopefully there's some other fix I can apply, without switching navigation off completely. Any ideas?

    (There's a similar question here - http://answers.unity3d.com/questions/1086857/navmeshagent-spins-on-the-spot-when-close-to-desti.html - but it mentions the stopping distance, and I've confirmed that increasing that seems to have no effect.)
     
  2. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,864
    This will be to do with rigidbody settings, and your agent settings. Tweak them starting with angular based values until they stop sliding about. You might need a friction physics material applied to surfaces.
     
    laurentlavigne likes this.
  3. weaglf

    weaglf

    Joined:
    Nov 1, 2016
    Posts:
    4
    I had the same problem and realised that rootmotion animator was causing it.
     
    BenHili, niuage and WinteryJungle9 like this.
  4. muhamad1987

    muhamad1987

    Joined:
    Jul 17, 2017
    Posts:
    14
    What solved the problem for me was to enable the IsKinematic attribute.
     
    Frojo and endae like this.
  5. giuseppeblando013

    giuseppeblando013

    Joined:
    Oct 25, 2022
    Posts:
    1
    I had a similar problem, I solved it by setting the quality to low, probably that's because with high quality the agent behaves like strictly and if misses the precise target point remakes the path.