- Home /
Path finding algorithm for 2d game
I want A* path finding algorithm for my 2d game. I have read about NevMesh but it doesn't work for 2d game. If you guys have implementation of A* algorithm for 2d game then please share it.
I'm pretty sure you'll find thousands of A* algorithms with a simple search.
But that don't work for 2d games. I want implementation that work for 2d game. I have found many code links but that didn't work for 2d game.
All pathfinding projects I've seen you could just as well use sprites ins$$anonymous$$d of 3d models and an orthographic camera and suddenly it's a 2d game that uses the same pathfinding.
I read in some post that it word with 3d colliders not 2d colliders. So I conclude that those A* algorithm not work for me. If you can suggest me better algorithm then it will become helpful to me.
A* is a generic algorithm for finding the shortest path beaten nodes on a network. As long as you can represent your path space as a network then A* is good. It doesn't really care about dimensions.
Answer by siddharth3322 · Oct 31, 2014 at 11:42 AM
I have to write algorithm from my self. I can't able to find 2d implementation of A* path finding algorithm.
To write algorithm, I found basic explanation from following site : Introduction to A* Pathfinding
I really appreciate their work. I have written code from their explanation as per my requirement if anybody want this implementation then message me any time.
@siddharth3322 Can you share your version of implementation ?
Okay but for this you have to give me a time. because at present I don't know where I have set my that project. $$anonymous$$essage me your email address.
i would love to see the project, can you mail it to me?! it would be life saving :)
You can send email address in P$$anonymous$$ to me.
Hi, can you share me your 2D implementation of A* Algorithm. It would be a big help. How to pm you my email. Thank you
Not OP but I got something you can use that can help you: https://github.com/RonenNess/Unity-2d-pathfinding
Answer by RayJr · Oct 29, 2014 at 01:53 PM
Take a look at HarshadK's answer in this question
http://answers.unity3d.com/questions/806298/c-how-to-move-an-npc-from-anyplace-to-a-specific-p.html
Your answer
Follow this Question
Related Questions
Unity2D Grid A* pathfinding freezing for a few seconds 1 Answer
How do i get the IsPathPossible() function to ignore some nodes using Astar Pathfinding Project 0 Answers
Implementation of Navmesh terrain dijkstra algorithm 0 Answers
How can I get my pathfinding algorithm to know that it cant go through certain sides of tiles 1 Answer