• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by siddharth3322 · Oct 29, 2014 at 01:22 PM · pathfindingalgorithmastar

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.

Comment
Bunny83
Hellium
theness_

People who like this

1 Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Unitraxx · Oct 29, 2014 at 01:25 PM 0
Share

I'm pretty sure you'll find thousands of A* algorithms with a simple search.

avatar image siddharth3322 · Oct 29, 2014 at 01:40 PM 0
Share

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.

avatar image Wisearn · Oct 29, 2014 at 01:44 PM 0
Share

All pathfinding projects I've seen you could just as well use sprites instead of 3d models and an orthographic camera and suddenly it's a 2d game that uses the same pathfinding.

avatar image siddharth3322 · Oct 29, 2014 at 01:47 PM 0
Share

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.

avatar image Kiwasi · Oct 30, 2014 at 05:34 AM 1
Share

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.

Show more comments

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

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.

Comment
Bunny83
Wolfos
ahungrybear

People who like this

3 Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image erayalakese · Sep 04, 2015 at 03:21 AM 0
Share

Can you share your implementation? @siddharth3322

avatar image sandeep_kumar_p · Sep 04, 2015 at 06:57 AM 0
Share

@siddharth3322 Can you share your version of implementation ?

avatar image siddharth3322 · Sep 04, 2015 at 07:04 AM 1
Share

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. Message me your email address.

avatar image saghiii · Jun 24, 2016 at 12:52 PM 0
Share

i would love to see the project, can you mail it to me?! it would be life saving :)

avatar image siddharth3322 saghiii · Jun 24, 2016 at 12:58 PM 0
Share

You can send email address in PM to me.

avatar image pammy10 siddharth3322 · Sep 27, 2016 at 03:44 AM 0
Share

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

avatar image theness_ saghiii · Oct 23, 2016 at 04:02 PM 0
Share

Not OP but I got something you can use that can help you: https://github.com/RonenNess/Unity-2d-pathfinding

avatar image

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

Comment
siddharth3322

People who like this

1 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image siddharth3322 · Oct 30, 2014 at 05:16 AM 0
Share

Thanks for this suggestion.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

33 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

A* pathfinding - incorrect nodes calculated 1 Answer

Force a scan with A* Pathfinding 2 Answers

GridGraph A* : how to verify if a point is attainable and how to use different graphs for different agents 0 Answers

[Solved] VERY LOW FPS using Astar path finding 1 Answer

Astar Pathfinding with unity 2d 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges