Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by adamzl · Apr 01, 2018 at 10:26 PM · navmeshnavmeshagent

NavMeshBuilder invalidates NavMeshAgent paths

I've started using NavMeshComponents to continuously bake updating navmeshes, all of this works fine. But for my NavMeshAgents they seem to have their paths invalidated when the bake finishes, they then recalculate paths automatically but this causes them to stop moving until their new path is ready.

Question: Is there a way for me to bake a NavMesh without invalidating my agent's paths? The perfect solution would be they continue using their "out-of-date" path until the new path is calculated.

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
1
Best Answer

Answer by Hidrem · Apr 02, 2018 at 05:11 AM

If I understand correctly, you are wanting navmeshagents to update their navmesh's in real time? If so I suggest watching this tutorial : https://youtu.be/FkLJ45Pt-mY

Comment
Add comment · Show 3 · 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 adamzl · Apr 02, 2018 at 06:28 AM 0
Share

I did learn something from the video you linked, but it didn't answer the question. Agents are generating paths from an existing navmesh, that navmesh is updated/baked/recalculated with new geometry and when it does this all the agents which were currently following paths have their paths invalidated and stop.

The big desire here is to use the async capabilities of agent pathfinding and navmeshbuilder to not block the game's update loop, but currently the model is causing agent stuttering.

avatar image adamzl · Apr 03, 2018 at 12:14 AM 0
Share

I'm just going to go with the Nav$$anonymous$$eshObstacles from the video you linked, I suppose the answer to my question is "you cannot and you shouldn't try". I'll just need to find gameplay ways to hide the times when I need a full Nav$$anonymous$$esh rebake.

Thank you for the video link Hidrem.

avatar image Hidrem adamzl · Apr 03, 2018 at 09:15 PM 0
Share

No worries and I'm glad that video helped you!

avatar image
0

Answer by duzbot · Apr 29, 2018 at 08:32 PM

hi @adamzl, I think i am suffering with the same problem.

here's a link to a video record of my particular situation https://www.youtube.com/watch?v=qLm3vIWTRNc

As you can see from what i'm trying to achieve with the revolving maze idea, a NavMeshObstacle won't do the job...

Just thought I'd share this with you and if you had any thoughts.,Hi @adamzl, I think i am suffering with the same problem.

Comment
Add comment · Show 3 · 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 duzbot · Apr 29, 2018 at 08:39 PM 0
Share

Just to add...

for some reason if I add an empty gameobject with a Nav$$anonymous$$eshLink component with no proper use, then the problem seems to go away for about a $$anonymous$$ute before the N$$anonymous$$A stops moving again. Seems a bit random why this offers a brief fix

avatar image adamzl · Apr 30, 2018 at 02:03 PM 0
Share

You should write the Nav$$anonymous$$eshAgent.destination every update, that'll probably fix your issue.

avatar image duzbot adamzl · Apr 30, 2018 at 03:46 PM 0
Share

I'll have to dig into the AI pathfinding script i've borrowed to check if it is or isn't doing that. Thanks for the tip.

Did you come to a fix or a solution to your original problem in the end?

avatar image
0

Answer by adamzl · Apr 30, 2018 at 06:14 PM

The fix for me was to stop using NavMeshes incorrectly. Anything that could change the NavMesh while agents were moving on the mesh had to be an NavMeshObstacle. The whole runtime calculation of nav meshes from geometry seems to only be useful if you're willing to bake before agents start using it and never again, mostly useful for run-time generated geometry.

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

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

Related Questions

Is there anyway to avoid a StackOverflow 0 Answers

Failed to create agent because it is not close enough to the NavMesh & "SetDestination" can only be called on an active agent that has been placed on a NavMesh. 1 Answer

NavMeshAgent not teleport on y axis 0 Answers

NavMesh agent pushed by bullet 0 Answers

How do I change my NavMesh Agent from one NavMesh to another? 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