Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 WarLordYT · Jan 20, 2014 at 06:04 AM · randomnavmeshnavmeshagentnavigation

[SOLVED] NavMeshAgent Create Imperfect Paths? [SOLVED]

Hello, I just started messing around with NavMeshes, and I could not find any way to stop Agents from always finding the perfect, and fastest path to it's 'destination?' Has anyone else had this problem? And has anyone found a method? Thanks :)

Comment
Add comment · Show 2
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 deltamish · Jan 20, 2014 at 06:30 AM 0
Share

Hi, i dont think i understood your question so you dont want the nav$$anonymous$$esh to find shortest path please explain a bit more

avatar image WarLordYT · Jan 20, 2014 at 07:26 AM 0
Share

Yes, I would like the Nav$$anonymous$$eshAgent to not be perfect, sometimes go a longer way to the destination, and stop all agents taking the exact same route (they always end up in a line -_-) Thanks for responding :) Sorry I didn't see it till now, my internet cut out :(

1 Reply

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

Answer by tanoshimi · Jan 20, 2014 at 09:17 AM

Interesting question. Unity's built-in NavMesh system, in common with most path-planning algorithms, is designed to efficiently calculate the single least-cost path, according to some definition of "cost". So, if you want different units to calculate different paths, you need to adjust their relative calculated cost of those paths.

Unfortunately, I don't think it's possible to add a random noise factor to path costs at runtime (which is what it sounds like you really want to do). However, one possibility is to ensure your NavMesh consists of lots of different layers (e.g. Road, Grass, Hill, Water etc. etc.) and then assign different per-layer costs for those layers for each agent. Thus, you will end up with units that have a preference to travelling across the "road" layer, some would prefer to go over "water" etc., and they should calculate different least-cost paths accordingly (note that your in-game terrain doesn't actually have to be road/water/grass - it could all be the same surface, but with "invisible" costs to each unit just to artificially create variation).

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 WarLordYT · Jan 20, 2014 at 10:11 AM 0
Share

THAN$$anonymous$$YOU for your answer! I appreciate the time you put in, and what you actually said, it answered my question! AND gave me a way to do it! THAN$$anonymous$$YOU @tanoshimi! :D

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

20 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

Related Questions

How would I simulate a rectangular Nav Mesh Agent? 0 Answers

NavMesh Components for 2017.4.9f1 1 Answer

Weird jumpy motion of character in Navigation Fundamentals proect 0 Answers

Runtime Navmesh not working on mobile build 0 Answers

Put (Instantiate) Gameobject along or accross a path Unity 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