Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
0
Question by Jokeman258 · Jul 05, 2014 at 03:03 AM · pathfindingalgorithmfree-version

2D A* pathfinding in free version?

Hi, I'm making a 2D RPG game where the character will be walking around different small towns. Each town will be a separate level so it won't be a seamless world. Anyways, I wanted to make his movements be where the player clicks and the player goes there (similar to in RuneScape) I was wondering if there's a simple way to do path-finding in a 2D game, with the free version of unity.

It would be very simple movements, just vertical and horizontal (no diagonals) and preferably on a grid.

I've been looking online and into things like A* and while I can kind of grasp the principles of A* i wouldn't even know how to begin translating that into code. Does anyone have an example code they could show me or a tutorial they could link me to that would explain how I go about making a code for the A* algorithm? Or if you know a simpler way I could do this, that would help too!

As a side-note, I've been thinking about getting the pro version, so if anyone knows what extra 2D-relevant tools come in it I would be interested in knowing that. I've also heard the pro version comes with built-in pathfinding. Is this true and to what extent?

Thanks!

Comment
Add comment · Show 2
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 SanderN · Jul 05, 2014 at 03:22 AM 0
Share

You don't have to write your own A* pathfinding script, you can use free version of A* Pathfinding project( http://arongranberg.com/astar/ ). I have been using it for a top down game and it works really well. What you want to do is not impossible at all with A* Pathfinding project. It has some basic scripts already in it that you can use (like Seeker and AIPath) that will make a character move towards the point you have assigned, so you don't really have to worry about the pathfinding part that much. So if you do use A* pathfinding project all you would have to do is figure out how to make it so that the place you are clicking on would become your characters next target and then assign that to the "target" in AIPath script.

avatar image PProductions · Jul 07, 2014 at 01:54 PM 0
Share

Not sure if this will be any use to you, but when I was doing pathfinding for my project I found this useful http://qiao.github.io/PathFinding.js/visual/ It let me play around with how the algorithms worked and how they searched through nodes

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by darthtelle · Jul 07, 2014 at 10:10 AM

I used this website to write the A* algorithm in my project. It's very helpful in talking through the principles and the code. Also, Wikipedia has a good pseudo-code section.

Edit: Hmm.. Unity doesn't like that Wiki link!! http://en.wikipedia.org/wiki/A*_search_algorithm#Pseudocode

Comment
Add comment · 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

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.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity 3.5: What is the definition of PLE algorithm? 1 Answer

A* optimization and path help 0 Answers

Preventing lines from overlapping 1 Answer

Help with A* algorithm 0 Answers

A* Implementation broken? 0 Answers


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