Hello Guest

Author Topic: A* Pathfinding Solution that is compatible with the Tilemap Editor?  (Read 3672 times)

Miyth

  • Newbie
  • *
  • Posts: 1
    • View Profile
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, 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.)

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
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.