#Drawing holes on tilemap's navigation layer?

7 messages · Page 1 of 1 (latest)

loud rover
#

i've set my navigation layer on my ground, it worked, but now how do I draw holes in it so that it tries to avoid my stone tiles
https://media.discordapp.net/attachments/762480166248513577/1094681949366390824/image.png

My tilesheet only have

  • Grounds
  • Grounds' corners
  • Water
  • Obstacles

Since the only traversable portion is the ground, so I've set up Navigation Layer in it and only in that tile. So now how do I tell Godot that the obstacles tiles are supposed to substract it?

light egret
#

There is no "tile subtraction" in navigation context. Navigation is not stackable in the same position like e.g. visuals. The simple answer is that you remove the tiles with a navigation polygon at that cell position.

jagged citrus
#

When you have a NavigationPolygon, you can put holes in it by adding a second polygon that is completely inside the outer one. But because each tile is it's own polygon, this probably won't work.You could make a second version of the ground-tiles without the navigation-layer, and then at runtime replace each tile that has an obstractle on top.

near sky
#

You could generate a astar2d for pathfinding

#

Based on the cells that are ground and corners

loud rover
#

So I moved the navigation into its own layer, and its own tile. But now how do I set NavigationAgent2D thickness? It really loves to squish it to the edge/borders/corners

#

No matter how much Radius I set on my agent, it will still squish it as if it has 0.001 thickness