Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Thomas Paniagua · Apr 07, 2012 at 08:37 PM · rigidbodynavmeshspeedsliding

How can I stop Navmesh agent sliding?

I recently tested the Navmesh feature if Unity 3.5, right now I have character with a rigid body and one without, both have Navmesh agents and I've tested them both, but when at high speeds they tend to slide past the target and never reach the stopping distance. The rigid body is not causing this so, how can i stop this sliding?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

6 Replies

· Add your reply
  • Sort: 
avatar image
21

Answer by Evil_Gia · May 16, 2012 at 02:32 AM

Try setting the acceleration to be a high number such as 60. Note that navMeshAgent stop its force at that location but will still move forward due to inertia. A high acceleration will make it stop very close to that exact location

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image b45h05h4 · Feb 11, 2014 at 10:19 AM 0
Share

Brilliant :)

avatar image omar_5 · Aug 29, 2021 at 10:29 AM 0
Share

I was looking for this for a couple of days, the agents were sliding on my target before stoping, This fixed it with an acceleration of 100

avatar image
2

Answer by jeffreylmeyer · Oct 10, 2018 at 02:46 AM

turn auto braking off

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image StartStart · Jun 18, 2020 at 06:15 AM 0
Share

Turn off Auto Braking worked for me!

avatar image
1

Answer by darrelcusey · Jun 18, 2015 at 01:17 AM

I'm seeing that this is STILL an issue in Unity 5. For anyone who is still experiencing this issue, here is a solution that works for me:

   public float acceleration = 2f;
   public float deceleration = 60f;
   public float closeEnoughMeters = 4f;
   private NavMeshAgent navMeshAgent;
 
   void Start()
   {
     navMeshAgent = gameObject.GetComponentInChildren<NavMeshAgent>();
   }
 
   void Update()
   {
     if (navMeshAgent)
     {
 
       // speed up slowly, but stop quickly
       if (navMeshAgent.hasPath)
         navMeshAgent.acceleration = (navMeshAgent.remainingDistance < closeEnoughMeters) ? deceleration : acceleration;
 
     }
 }
 
 
Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image WizzDE · Aug 06, 2015 at 10:36 AM 0
Share

Thanks! That works just great!

avatar image
1

Answer by nonopblic · Jul 22, 2017 at 07:50 AM

in my case, setting acceleration to 60 does not work. so i have to create another solution like this.

 if (Vector3.Distance(target, transform.position) < navMeshAgent.stoppingDistance)
 {
 navMeshAgent.SetDestination(transform.position);
 }
 else
 {
 navMeshAgent.SetDestination(target);
 }
 
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by jolta · Jan 10, 2018 at 08:21 AM

I got the Same Issue but my character was slipping while turning. This works for me. Increase "Acceleration" and increase "Angular Speed". Values for my Character Speed=30 Angular Speed=300 Acceleration=140

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
  • 1
  • 2
  • ›

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Rigidbody gain speed falling on slope 0 Answers

Kinematic how to know rigidbody velocity vector? 1 Answer

How do I make my character's speed stay consistent? 0 Answers

Make object fall with constant speed! 4 Answers

Navmesh and Rigidbody Causing Camera Jitter 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges