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
0
Question by Nanako · Feb 28, 2015 at 07:10 PM · navmeshnavmeshagent

Why does my navmesh pathfinding get screwed up after i hit a wall?

i have a creature with a navmesh agent, a rigidbody, and a collider. Here are the parameters on all three alt text

Here's the area i'm working with, it's a simple square playpen, with the sides nd floor set to navmesh static. Note the navmesh in the middle. I do not know why this isn't sitting perfectly in there, but it isn't. the navmesh seems to slope upwards towards the lowerleft corner, despite the floor being utterly flat.

alt text

The puppy can path around this area just fine. i've got it set to run to the spot where ik click, this has no adverse effects. It stops pretty close to the target point:

alt text

However i have a problem. If i click on the walls of the pen (which are not pathable, as seen in the navmesh picture) then things start to get screwed up. The puppy bounces off them, and then becomes unable to properly navigate to anything until i exit and restart play mode

Here's an example of the puppy bouncing off then getting screwed up:

alt text

And then after that, until i restart play mode, he becomes unable to come to a rest on a target spot, instead fidgeting around it endlessly, like this:

alt text

So yea, what gieves? If the nav mesh agent is given a target it can't path to, shouldn't it either get as close as it can and then stop, or just refuse to move at all? How is the puppy pathing to these areas, and why is it subsequently getting messed up

Comment
Add comment · Show 8
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 Nanako · Mar 01, 2015 at 11:26 PM 0
Share

Is there any information i could provide that would assist in debugging this? I'm quite new to pathfinding and navmeshes.

avatar image Baste · Mar 02, 2015 at 12:12 AM 0
Share

As a general rule, you don't use physics when you're moving with a navmesh agent. Either remove the rigidbody, or if you need it, turn it static.

Debug the current path with NavmeshAgent.pathStatus, that'll give you "complete", which means that the path exists, "partial", which means that the agent can get some of the way, or "invalid", which means that the agent cannot move.

You can also look into the path (agent.path), which contains an array of corners, which are the points at which the agent will move through.

Finally, make sure that you're reading your console messages. The error you're getting is probably accompanied by something along the lines of "the agent has to be placed on a navmesh!"

avatar image Nanako · Mar 02, 2015 at 12:46 AM 0
Share

I am using physics, 100% certain. if that interferes with navmesh agents then i won't use navmesh agents. Is it possible to get the list of path coordinates and handle moving to them myself?

For that matter, has anyone written a physical navmeshagent class ?

i'll look into that

avatar image Baste · Mar 02, 2015 at 07:44 AM 0
Share

In our game, I'm moving manually based on the navmesh. You do that by ditching the navmesh agent, and using the static method Nav$$anonymous$$esh.CalculatePath to get a path that you can follow.

avatar image Nanako · Mar 03, 2015 at 07:49 AM 0
Share

thank you baste. But this sort of manual pathing seems to open a can of worms. ie, there's lots of problems like the overshooting thing, and the autobraking near the target point. parts of the navmehagent i'd really like to have in physical movement.

Certainly i can replicate it all, but hasn';t anyone already done that? i'd rather use a pre-written library.

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

Navmesh Path is shown even between disconnected regions.? 0 Answers

Lack of Bi-Direction OffMeshLinks for Jumping Up? 0 Answers

Instantiated objects at beginning of runtime are messing with the pathing for my NavMesh. 0 Answers

Find the nearest location and move to a target outside Navigation Mesh? 1 Answer

NavMesh Agent glitches on navmesh edges 2 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