Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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 Jkight1212 · Apr 28 at 03:49 AM · navmeshagent

How do I make the NavMeshAgent more stupider?

It should be simple but I have no idea how to do it.

I have a player character that moves with the NavMeshAgent, and I have a system where my character can roll, this also uses the NavMeshAgent because it works with the system I have set up already. On open ground this works exactly as I want it to, but when I roll towards an obstacle such as a wall without enough space to actually roll, what should happen is my character simply smashes his face against the wall like a dumdum. Instead, he tries to go around the wall.

Simply put, I would like to be able to temporarily turn off a navAgent's obstacle avoidance entirely.

How does do?

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
0

Answer by AmiraKing · Apr 29 at 07:18 AM

Hello,

Thanks for asking this because, I faced similar kind of issue last time, I am still searching for some proper solution Same issue still no fix to this. My Insite Sign In This is probably a bizarre request - I would like to have my agents not knowing the entire map. For example, a wolf sees you across an iron bar gate, if using regular navmeshagent on the wolf, he would (very intelligently) run a mile around the walls and find a way to you and attack you. It's not very realistic. Ideally the wolf would not know how to get to you, so he just run to the iron gate (of course, bypassing whatever obstacles between him and the gate) and howl at you or something.

It would be nice if there are two things that can be done by navmeshagent:

Check if the calculated path is too long (this can be done using "remainingDistance")

If it is too long, calculate a closest reachable location (i.e. right behind the iron gate)

I'm not sure how #2 can be done. I know there are navmesh areas, and area mask, is it possible to calculate path only within a certain area so as a last resort the agent will go to the closest reachable location?

Please Help Us

Thank you

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 Jkight1212 · May 02 at 02:02 AM 0
Share
  1. Raycast to your target to see if there is an object in the way.

  2. If the Raycast hits something and that something is tagged "Structure", get the RaycastHit.point from that Raycast. (I use structure it doesn't have to be that word)

  3. make your navAgent for the wolf go to that point, instead of to the player.

  4. since that point is inside the fence, wolfy boi will go to the nearest point it can get to. (which means it will be on it's side of the fence)

  5. repeat in update function, or possibly on a tick system if you don't want to run a navAgent.SetDestination every frame. (since that can be a fairly expensive call).

That's essentially what I did to fix my problem. It feels bad because you are building a fix to remove a feature, when it would be better to just have some way to remove the feature, but there it is. EDIT formatting

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

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

Related Questions

Survival Shooter Phase 4 - Enemy not homing 1 Answer

NavMesh agent won't rotate around Y axis 0 Answers

Standard Asset AIThirdPersonCharacter always on falling animation 0 Answers

Weird navigation issue 0 Answers

5.6 Runtime Navmesh and Agent Delayed Connection Issues 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