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
0
Question by carter-carl30 · Jul 09, 2017 at 02:21 PM · sceneainavmeshnavmeshagent

Multiple Nav Mesh in same scene?

I have a scene in which I have built 3 areas (they exist in same scene over the top of each other with one active and others deactivated.

I have 3 AI's in the scene using nav mesh to navigate around.

I have trggers set up so that when the player enters the trigger it hides one area and makes another active eg: player enters lava cave trigger > forest area setactive(false) > lava setactive(true)

Is it possible to have different nav meshes for each areas geometry? I was looking at layers but I don't know how I would tell unity to use a specific layer when an area is active, if this is even possible?

Comment
Add comment · Show 3
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 FortisVenaliter · Jul 09, 2017 at 03:05 PM 0
Share

What problem are you trying to solve? $$anonymous$$g. what's preventing you from using one Nav$$anonymous$$esh for all three areas?

avatar image carter-carl30 FortisVenaliter · Jul 09, 2017 at 03:49 PM 0
Share

For example if I am currently in the lava area (has ramps upto platforms etc) then I go to the trigger to load the forest area (activate (disabling the laval level geometry)).

The AI's still seem to be following the lava nav mesh for example walking up invisible ramps, which are not there in the forest scene so they are doing so in mid air.

avatar image Zezzman · Jul 10, 2017 at 02:37 PM 0
Share

Are you using Nav$$anonymous$$eshLink to move from one Nav$$anonymous$$esh to another ?

1 Reply

· Add your reply
  • Sort: 
avatar image
-2

Answer by ahorne · Jul 10, 2017 at 07:04 PM

Yes Yes. This is totally doable.

https://docs.unity3d.com/Manual/NavMesh-BuildingComponents.html https://github.com/Unity-Technologies/NavMeshComponents

I am not sure what you are trying to accomplish though with 3 overlapping navmeshes, only one of which you want active at a time. If you are having different navmeshes for different AgentTypes, they can all actively exist at the same time, you don't need to deactivate all but one. Just keep the AgentTypes different. If you are using NavMeshLink you'll need a link for each AgentType as well.

Good Luck!

Comment
Add comment · Show 3 · 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 carter-carl30 · Jul 10, 2017 at 07:53 PM 0
Share

ok, let me try and explain what i'm doing:

I had trouble with the third person character & controls setup. When I loaded a new scene by entering a trigger object the new scene would load and the player would just move on it's own with player having no control see: http://answers.unity3d.com/questions/1374747/third-person-controller-and-switching-scenes.html

So to get around this I decided to save each scene into an empty gameobject and have them all in the same scene. So in one scene I have different game objects containing the scenes eg: forest, lava, scifi etc If you are in forest the other gameobject (levels) are deactivated.

I have triggers so that you can walk into a new area, which will deactivate the current gameobject and activate the new one say lava level for instance.

Sooo, if I select the forest area and bake a navmesh everything fine, AI's walk around over ramps etc bump into trees.

then if i deactivate the forest level and activate the lava one and bake the nav mesh that works also but when I activate the forest one again the navmesh is that of the lava level.

I tried setting a different layer for each nav mesh but I dont know how to tell unity to use say layer 3 lava navmesh when lava level is active or layer 1 forest navmesh when forest is active.

sorry if this sounds crazy trying this navmesh stuff for the first time in this game!

avatar image ahorne carter-carl30 · Jul 10, 2017 at 07:58 PM -1
Share

Rendering/Physics layers are probably not the way to go here. Are you using Nav$$anonymous$$eshSurfaces or just Nav$$anonymous$$esh and loading multiple scenes? Are you baking Nav$$anonymous$$esh/Surface's at runtime?

avatar image carter-carl30 ahorne · Jul 16, 2017 at 12:05 PM 0
Share

I just select the objects and make walkable (or not if tree etc) then bake.

I'm not loading any scenes it's all in the same scene.

On the navigation panel, I have made forest user layer 0, lava user layer 1 and scifi user layer 2 (all cost 1).

I want to be able to say if forest area active, use navmesh layer 1, if lava use navmesh layer 2 etc. (if this is possible).

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

117 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

Related Questions

NavMesh Agent Obstacle Avoidance Ignore 1 Answer

How to make AICharacterController able to walk on walls and ceilings? 0 Answers

Is there any way to make the vertical automatically-generated Mesh Links from the NavMesh bidirectional? 0 Answers

Keep AI from flipping? 1 Answer

Check if navmeshagent is touching a navmesh 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