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
0
Question by Turkeybag · Oct 14, 2014 at 01:17 AM · navmeshnavmeshagentjitteringglitchingstopping

Navmeshagents stopping for no reason.

Hey! So I was testing some things with navmeshs and when I had 52 agents at once all calling Agent.SetDestination(PlayerTransform.position) in the update functon, the agents would all stop for a short time and then start up again, happening once every now and then. Obviously it's a bad idea to do that many calls but I was wondering if there is a way to fix this as it has happened with other, smaller amounts of agents making the calls a lot less often (the stopping just happens less often and doesn't last as long).

I've had another project in the past that had 500 agents moving at once with SetDestination() in Update() and it didn't have any problems. I was wondering what the reasoning is. The navmesh I'm using atm is more complex than the one that had 500 agents but not by quite a bit but it's still really simple.

alt text

I was mainly wondering if this is a bug, if there is a way to fix it, or does navmesh just have it's limits even if I have a lot more power on my PC to run more agents and what are those limits so I can plan ahead. Any help is appreciated.

navmesh.png (236.5 kB)
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

3 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by JanusMirith · Oct 14, 2014 at 03:21 AM

The SetDestination() function works over a few frames to spread the load of the calculations.

You could try a few things:

Try setting a queue for the agents and update them in separate frames.

Make the mesh more simple, from the settings or by adding more basic invisible geometry instead of the more complicated visible geometry.

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 Turkeybag · Oct 14, 2014 at 03:34 AM 0
Share

Ahh. Is it possible to keep them walking to their last destination as it appears that they cancel that when the next one starts and that's what causes the stopping I think.

avatar image JanusMirith · Oct 14, 2014 at 04:17 AM 0
Share

You could place the visuals on a different object with a smoothed follow script or a extrapolation algorithm to give a bit more of a organic feel to the stop and start.

Updating the target at different times per npc will also make things look a bit better, make it look like they are thinking (it is not a bug it is a feature :) )

avatar image
1

Answer by Unshackled · Jun 26, 2019 at 04:56 PM

On your NavMeshAgent, uncheck autobraking. This will not allow them to stop when recalculating the path.

I stole this from another post but it worked for me so reposting here.

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 Trumped · Jul 27, 2021 at 11:10 AM

I recently had a Problem and fixed it by Moving my Spawn points closer too the navmesh for some reason if you don't spawn them close to the navmesh they will auto correct too it but have strange stuttering when they move.

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

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

31 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 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 avatar image

Related Questions

NavMesh Lookat causes jittery glitch in character 0 Answers

NavMesh flee. Ai flee from player. 4 Answers

Navmesh problem with characters rotation in the terrain 1 Answer

NavMesh Agent rotates on X axis when moving and snaps back to 0. 2 Answers

Tank not moving towards player 1 Answer


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