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

Avoid diagonal path #1

Closed
mrjeanjean opened this issue Mar 2, 2017 · 2 comments
Closed

Avoid diagonal path #1

mrjeanjean opened this issue Mar 2, 2017 · 2 comments
Labels

Comments

@mrjeanjean
Copy link

Thanks for your transcription. It's easier to implement with this way.
Just a question. Do you know a way to avoid diagonal path between two tiles (I just need left <->right, bottom<->up behavior)? I'll try to implement it as an option. But if you think about a way to proceed... :)
Thanks in advance.

@RonenNess
Copy link
Owner

Hi mOveoStudio,

You should change this function:
https://github.com/RonenNess/Unity-2d-pathfinding/blob/master/PathFinding/Grid.cs#L59

And make it return only the top / bottom / left / right neighbors.
I think it should do the trick, please let me know if its working or not so I can close the ticket.

Thanks! :)

@mrjeanjean
Copy link
Author

Thanks Ronen. That's exactly the point! That calls the Von Neumann neighborhood (Wikipedia said ;)).
Thanks again.

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

No branches or pull requests

2 participants