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 /
avatar image
2
Question by vdwtanner · Sep 27, 2016 at 06:34 PM · ainavmeshnavmeshagentpathing

Is it possible to have a navmesh agent that ignores obstacles?

I am using navmesh agents to handle pathing for enemy units, but I've come upon a use case where I have certain units that I want to ignore obstacles in their path. (Ex: Massive unit can walk over and destroy buildings in its path). I saw this question and comment that says that the navmesh doesn't currently support it, but that was 3 years ago and I was hoping that this feature may have been implemented since then. If it hasn't, has anyone come up with a solution/work around to this?

Thanks!

Using Unity 5.4.0f3

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

Answer by juicyz · Sep 27, 2016 at 06:56 PM

I think you will want to look into: https://docs.unity3d.com/ScriptReference/NavMeshAgent-areaMask.html

Another solution is that you could also make a custom 'navigator'. Basically don't use NavMesh and just make the unit walk along a tangent line (straight at its target)

Comment
Add comment · Show 4 · 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 vdwtanner · Sep 28, 2016 at 01:27 AM 0
Share

Hmm, I think the Area$$anonymous$$ask might work... I'll just have to define a mask for buildings and then each time a building is built apply that mask to that area of the mesh. $$anonymous$$ight also solve another one of my issues if I can just query the mesh to see if there is already something in the area that a new building would end up occupying. I'll accept the answer in a day or two after I've had time to implement this. Thanks for the advice!

avatar image vdwtanner · Sep 28, 2016 at 04:12 AM 0
Share

Accepting as correct since this route (area$$anonymous$$ask) was the correct direction to take and will be for anyone looking for a way to do this statically. Unfortunately though, it turns out that you can't bake Nav$$anonymous$$eshes at runtime, so there's no way to make this feasible in my use case. Will need to implement my own system or drop this part of the game unfortunately.

avatar image fgbg vdwtanner · Mar 04, 2017 at 11:10 PM 0
Share

What was your final solution? I'm trying to get two units to walk into each other using nav mesh agents but they also try to avoid each other at the same time.

avatar image vdwtanner fgbg · Mar 14, 2017 at 12:50 AM 0
Share

This was just a small side project for me to "scratch an itch," and I ended up dropping it due to my work load at school and work. I am doing something similar to what you want in UE4 for a project for school that I'm working on right now though. $$anonymous$$y current solution is to disable obstacle avoidance when the attacker gets close enough to its target. It's been a while since I've used Unity's nav system now, but I want to say that you can achieve something similar in there. It may also be possible to calculate a path that just has to get within radius X of the target and then simple path (not relying on nav agent movement) after that. Best of luck to you!

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

84 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

Related Questions

How do I limit the path of a NavMeshAgent? 0 Answers

Need help detecting barriers for my game 0 Answers

Rotating the a NavMeshAgent when going up- or downhill? 1 Answer

Make AI follow player without jumping about 0 Answers

Connecting two navmeshes without "Speedboost" 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