- Home /
Duplicate Question
How to find path in a boolean 2D array?
Hi,
Is there any easy way to find path in a 2D array that is composed of boolean values, 1 for filled and 0 for empty?
My maps are consisted of such array and I need to be able to find paths in it for various reasons.
I'm aware of NavMesh but since maps or generated at runtime, I cannot do calculations offline.
If possible, please suggest any pathfinding asset that might help.
Best,
You don't have to reply if you don't and can't have any positive input.
It's obvious from my post that I'm well aware of "pathfinding" and posted this to get an "answer" regarding my question.
If you're well aware of it, then you know the answer!
I don't understand what's so difficult? You need to find a path between two points on your 2D array. The technique for doing so is called pathfinding. The rest is up to you
@UnbreakableOne:
First of all this kind of question has been asked several times and Ben's "search" should give you almost all you need. However maybe you want to use something like this:
https://www.google.com/#q=unity+pathfinding
I don't see a question that can be answered in a straight way here. This site is not for suggestions or discussions. Also using the site internal tagging system should give you more than you ever need. If that doesn't find you the right answer you might try a site specific google search:
https://www.google.com/#q=site:answers.unity3d.com%20pathfinding
Follow this Question
Related Questions
Pathfinding on Instantiated AI Vehicles 0 Answers
Grid-based path-finding, similar to Legend of Grimrock/Eye of the Beholder... 2 Answers
How to minimize directional changes of A* autopathing movement? 0 Answers
How to call a method once inside fixed update 1 Answer
Generic list of objects, then distance to those objects? (js) 1 Answer