Home › Forums › General Discussion › Is there any way to manipulate NavMeshes?
This topic contains 4 replies, has 3 voices, and was last updated by prime 5 days, 1 hour ago.
January 26, 2023 at 4:19 pm #6642
Let’s say I didn’t like some areas of how my NavMesh came out. What options do I have? Is there any way to edit or remove particular areas of the NavMesh?
Also, let’s say before the NavMesh calculation that I decide to exclude a certain area of the map (i.e. a pond that the AI should avoid walking into). How would I go about making sure this area is excluded? I have tried this:
- Putting placeholder giant Cubes in the pond area with a collider so that it is treated as an “obstacle” in the NavMesh. However, the NavMesh will generate walkable areas on top of the Cube and sometimes hanging off it to the ground, which is a bit funny. Adding the Cube’s tag to the NavMesh “Unwalkable tags” seems to have no effect. Is there a way to prevent the NavMesh from generating on top of an object, but still treat it as a general “obstacle”?January 27, 2023 at 1:48 pm #6648
We have plans to add support for manual navmesh editing, but it isn’t there yet. Usually you can correct issues either by changing your navmesh parameters or by adding/modding the colliders in that area.
You can exclude areas using tags to mark the areas you want to have ignored, then add those tags to the unwalkable list on the navmesh. The placeholder cubes you are using should be working as you expect - you mentioned this isn’t working for you so I’ll go check it later today and make sure we didn’t introduce a bug in a recent build.
Sounds like you are on the right track though. I’ll follow up in a bit.January 27, 2023 at 3:04 pm #6651
I wonder if there is an actual problem with there being a “walkable” area on top of the Cubes. Are you worried that the AI might try to reach the top and then walk around? Perhaps dropping the height of the NavMesh generation area below the top of the Cubes might help. Unless, of course, there is more terrain that needs to be included and is much taller than the Cubes.
January 27, 2023 at 10:22 pm #6658
- This reply was modified 5 days, 16 hours ago by Iuxeayor. Reason: Clarification
Thank for the replies! Btw I have the latest version 2.0.9. I will double-check but here’s what I have found, in response to prime and luxeayor:
prime: When you say mark the areas “ignored”, do you mean uncheck those layers from the NavMesh? Or mark their tags as both in the Ignored Tags list and the Unwalkable Tags list? I believe I tried both these approaches but no luck.
luxeayor: Yes, generally that is the case I am worried about. I am wondering in the tutorial example where we have the soldier wandering to randomly generated places, what happens if his target is in a place he cannot reach? Secondly, it seems that a NavMesh will be generated over any object that is even partially contained in the NavMesh boundaries. I extended these placeholder cubes to be far over the height, but it still generated walkable areas on it.January 28, 2023 at 5:36 am #6663
I just mean that the places you don’t want walkable can be excluded by adding their tags to the unwalkable list. Don’t add them to the ignored tags list - just to the unwalkable list.
- As for the soldier wandering to places he can’t reach - the latest tutorial file should be doing a check to make sure there is a valid graph connecting the ai to the target position. This doesn’t do a path check though, just a check for a shared graph.
- Correct, the recast bounding box does not clip colliders that overlap in the y axis, even if they extend well outside (above or below) the recast area. Your approach of making these colliders unwalkable should do what you want though.
You must be logged in to reply to this topic.