- Home /
where can i learn c# pathfinding?
im making a tower defence game, where can i learn how to code pathfinding, any tutorials? or can anyone start me off with a little code? thanks.
Answer by Jesse Anders · Jan 19, 2011 at 09:07 PM
Pathfinding usually requires more than 'a little code', so it's unlikely you'll get any complete code samples here. However, there's at least a couple of third-party pathfinding libraries available that work with Unity that might meet your needs. (Search the forums for 'pathfinding library' and you should find them.)
Beyond that, pathfinding is a general topic that isn't tied to Unity or any specific programming language, so you can find info on it just about anywhere. Also, note that there are many different approaches to pathfinding, and which will work best will depend on the context. So, if you need more specific advice, it would help if you could provide more information about the setting. (For example, what's the environment like? Is it grid-based? What sort of obstacles are there? And so on.)
ok, i understand man. thanks :) to be honest right now i just want to know the basics eg, move the ai in a simple path like left, down then right and so on just on a simple flat surface. just so i know what i need to make the ai move. not considering any obsticles at the moment. i heard about waypoints so i think ill start there. thanks for the info :)
Then that is not really pathfinding as you are not finding a path, just following waypoints. Then I would recommend iTween or something.
Answer by systemoutprintln · Nov 06, 2012 at 06:58 PM
Here is some basic code you should start of with. public class pathfinding{ }
good luck.
Answer by Daten · Nov 06, 2012 at 02:57 PM
Look up A* Pathfinding, its free and a good simple library to use!