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
1
Question by Zyrac · Jun 08, 2017 at 01:13 PM · navmeshnavmeshagentruntime-generation

5.6 Runtime Navmesh and Agent Delayed Connection Issues

So, I'm working on a game in which the map is randomly generated each time it's started. Just to give you an idea: The terrain is basically built up of multiple cuboids all positioned at -1 on the Y axis and at various points on the X and Z axes so it basically just makes a large flat area composed of tiles which allows me to have various resources randomly placed (or not) on them and allows me to have a fog of war system where each has its mesh renderer enabled as the player gets close to it. The player then starts at 0.6 on the Y axis (this just seemed to work best).

When I saw that 5.6 implemented NavMeshes that could be baked on runtime I thought it was great because it would solve my pathing issues. And I have got it to work, except for the fact that there seems to be an issue with the Agent connecting to the mesh. After the game starts, I get a message in the console saying "Failed to create agent because it is not close enough to the NavMesh." If I wait a few minutes, the Agent seems to be shoved downward a little on the Y axis in a janky kind of way, at which point it seems to connect to the NavMesh and it works. But this is an issue because obviously it's no good that it takes so long to kick in and also the agent being pushed down means it clips through the terrain. I tried playing around with the Agent component's Base Offset parameter to see if that helped but it didn't seem to make a difference. Anyone have any advice about what's going wrong?

Thanks!

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by crimi · Jun 12, 2017 at 08:06 AM

Try to setup the LocalNavMeshBuilder Area first in your scene and during runtime add NavMeshSourceTag to your dynamic generated content.

It might help to spawn your NPC with a delay.

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 crimi · Jun 12, 2017 at 12:38 PM 0
Share

I found something interesting this solution works now very well for me even in multiplayer.

Edit > Project Settings > Script Execution Order https://docs.unity3d.com/$$anonymous$$anual/class-ScriptExecution.html

LocalNav$$anonymous$$eshBuilder, Nav$$anonymous$$eshSourceTag

Add them both on top ahead of the default time. Now they will be executed before everything else.

avatar image
0

Answer by tMahon · Jun 12, 2017 at 06:53 AM

Potentially all of the box colliders around each cube could be giving you some issues, I've noticed this making procedurally created games because tile by tile seems the easiest way at first. Try putting a plane over the top of the tiles where the floor would be to collide with them, your characters might float a smidge but it beats clipping. Barring that, you could totally reconfigure your collision to work on a Raycast Overlap Sphere (Really only works if you're moving transform.position manually each frame)

Comment
Add comment · 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

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

70 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

Related Questions

How to make whole navmesh agent avoid carves rather then center of it? 0 Answers

Precise distance calculation with high timeScale for NavMeshAgents? 1 Answer

Navmesh is broken on stairs 2 Answers

How to gradually increase the speed of a NavMesh agent? 2 Answers

Gaps in the Nav mesh 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