Critical bug with unwalkable areas

I was fighting with unwalkable areas not baking properly for like 3 days and finally I found that it is bug in AstarPathfindingProject (whyyy combinations of two stars symbol on this forum make italic font :D). When bounds are “centered” in world evrything is ok. But when bounds are much bigger than “main world” unwalkable areas become walkable (like truly walkable, not only visual bug on graph). Here is quick video:

There are at least two ways to reproduce it - you can set manually much bigger bounds than automatic or you can place small meshes around world and bake automatic ones. I can send you small project when it is fully reproduced (I don’t post it here because I’m using A*pro) or I can tell you step by step how to reproduce it:

  1. Create new scene
  2. Add Pathfinder
  3. Add plane and set it’s transform as shown
    https://gyazo.com/5b7b4b64151a5f52dd553261608644c7
  4. Add cube and set it as shown
    https://gyazo.com/5dfe33dad27ef9592e398d915504f588
  5. Add recast graph and set its bounds to automatic and change Y to 100
    https://gyazo.com/93d4d9d447bc11535d27a94910c2cce5
    (funny fact here - if you set it to other value you can find “special one” which are working correctly https://gyazo.com/817a36ab20af5ef21e46957ca056419f)
    Thats all in general, it’s very problematic for me tbh becauce I have mesheseh that are apart of “main game content” and when I set bounding box to automatic then my unwalkable areas goes crazy :frowning:

Hi

Hi

So from what I can tell you are using that cube both as a thing that you generate the navmesh on, and as a bounding box to make all nodes inside it unwalkable.
The problem with that approach is that the navmesh is generated on top of the cube, but the graph update scene component will update all triangles inside the cube. Depending on floating point rounding the navmesh vertices may or may not end up laying inside the bounding box of the cube or they may end up being just a tiny amount above the top of the cube.
I would suggest that you make a child object of the cube with a GraphUpdateObject that has a bounding box that extends to completely cover the cube along the Y axis.

1 Like

OMG, you’re right. Thanks, looks like it is working now exatly like it should. Thanks Aron, ure great <3 I need to go to assetstore and make my 5* rating :smiley:

1 Like

One more thing to this - when I cache navmesh with baked nonwalkables and press play then unwalkable areas are walkable again. I have to rebake navmesh once more in playmode to make them unwalkable again. Is there some setting that I’m missing?

Hi

Are you sure you saved the cach when the triangles were unwalkable, and that you didn’t just cache the graph settings?
Also. Are you using any navmesh cutting?

In general I’m using navmesh cut but not in this case. I have RecastMeshObject and in child I have GraphUpdateScene. It looks like this when not in playmode:
https://gyazo.com/ded60b07297cc694e1feabdefe03814a
But when I enter playmode its like this:
https://gyazo.com/119b2e082c7a495482968ef5acb181a6
I’ve tried to “Generate cache” and “Save to file” with scaning before and with scaning while saving, no succes, I have “Cahce startup” enabled and “Scan on Awake” disabled.

Since we are talking about same problem in two topics right now, I suggest we stay in another one - here is the link GraphUpdateScene - object share recast mesh triangles