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
2
Question by Jean-Fabre · Dec 28, 2011 at 11:30 AM · navmeshdistance

navmesh remaining distance wrong when destination outside navmesh

Hi,

Currently testing navmesh and agents and I find something odd.

If I set the destination to a position outside the navMesh, the agent stops at the navmesh limit but the remaining distance keeps decreasing until 0... which is wrong visually.

Is this the expected behavior and if so how I detect that an agent actually IS located at the destination. Comparing the position manually? seems odd and an api flag of some sort would be better I feel...

Thanks,

Jean

Thanks,

Jean

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

1 Reply

· Add your reply
  • Sort: 
avatar image
3

Answer by Jakob_Unity · Jan 05, 2012 at 01:26 AM

Hi Jean,

Before acquiring a path the destination point is mapped onto the walkable surface of the navmesh. This end-point (NavMeshAgent.destination) may differ from the world space position you assigned.

NavMeshAgent.remainingDistance is the remaining distance of the path you currently have (or infinite if not known) - not the distance to the world space position argument to the destination.

If the path destination is on a disconnected region of navmesh (with respect to the agent) - the resulting path will have the status "PathPartial"(NavMeshAgent.pathStatus)

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 Jean-Fabre · Jan 05, 2012 at 05:01 AM 0
Share

the point mapping is actually the same as I had used Nav$$anonymous$$esh.SamplePosition right? So there is no way to actually know where an Agent really is on the path? because I suspect that if several agents are fighting for the same destination their .remainingDistance will also come down to 0 even tho they are because other Agents are bloking. $$anonymous$$aybe I should move this onto a forum thread. http://forum.unity3d.com/threads/118129-Nav$$anonymous$$eshAgent.destination-partialpath-and-actual-progress-of-Agent-along-current-path?p=789893#post789893

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Precise distance calculation with high timeScale for NavMeshAgents? 1 Answer

Make Navmesh agent follow closest object with tag 0 Answers

How to detect if NavAgent has reached hit.point? (2) Distance doesn't work? 1 Answer

Find closest "item" object by NavMesh navigation distance performantly 0 Answers

Navmesh Agent get distance 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