finding path out of unwalkable area
Warren93 opened this issue · 0 comments
I've noticed that if you try to generate a path where the starting point is already in an unwalkable area, the pathfinding fails. This makes sense. My question is, how do I get around this issue if I need to allow the user/player to get a path out of an unwalkable area that they're currently stuck in? I have tried gathering all the tile coordinates of the tiles in the unwalkable area where the player is starting from and then calling setAdditionalPointCost
on each tile, setting its point cost to zero (i.e. same cost as walkable area in my case). But this does not seem to have the desired effect of making the area in the player's vicinity walkable/path-able. Is there any straightforward way of getting around this issue? Thanks in advance for any help.