Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

finding path out of unwalkable area #90

Open
Warren93 opened this issue Feb 27, 2021 · 0 comments
Open

finding path out of unwalkable area #90

Warren93 opened this issue Feb 27, 2021 · 0 comments

Comments

@Warren93
Copy link

Warren93 commented Feb 27, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant