2D Toolkit Forum

2D Toolkit => Support => Topic started by: Miyth on May 27, 2013, 01:16:21 am

Title: A* Pathfinding Solution that is compatible with the Tilemap Editor?
Post by: Miyth on May 27, 2013, 01:16:21 am
Hi there,

Recently I've been working on a new project using Tk2d and it's been really helpful for rapidly prototyping our game's look and feel, and the Tilemap editor has saved us a ton of time.

I'm trying to implement a basic A* Pathfinding system for the game (Using This one (http://forum.unity3d.com/threads/164003-Released-BFGames-Simply-A*-Pathfinding!), if that helps any), but encountering problems with it.

It seems like every Grid-based Pathfinding solution I've come across uses the top of the Mesh to determine walkable and unwalkable areas- but the Mesh Colliders generated by the tilemap don't actually have tops.

Does anyone know of a better way to handle pathfinding with the tilemap system for a top-down game, or do I need to pick between using this pathfinding system and the tilemap? (I realize I could just go back through and add in my own colliders, but if I do that I may as well fall back on creating my own tile system.)
Title: Re: A* Pathfinding Solution that is compatible with the Tilemap Editor?
Post by: unikronsoftware on May 27, 2013, 11:36:58 am
Mesh colliders generated by tilemaps can have tops if you are using polygon colliders - if you are, in the sprite collection editor, select collider cap = front & back to close both the fronts and backs. Don't forget to click Apply.

If you're using box colliders, then you'll have to change a bit of code, but I'll add it as an option in the next release.