Pathfinding on Tilemaps?

0 favourites
  • 3 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • Hi Guys,

    I'm very new so, please be kind :)

    Is it possible to have pathfinding work successfully within tilemaps?

    I have the following set-up, when you right click a tile it removes it so, should no longer be an obstacle but, when you left click to add a path where a tile was previously removed it doesn't work as expected. If however you click in the open area and around the orange tiles it works fine.

    dropbox.com/s/i2kqd90tegxihpy/PathfindTilemaps.capx

    I'm guessing it might be due to setting regenerate map but, have tried a few places with no luck.

    Hope that makes sense, thanks in advance.

  • I played around with the cell size & border and have it moving around now however;

    If I click on the tiles as soon as the level loads the pathfinding ignores the tiles and creates nodes over them. Probably something to do with regeneration of the map in the correct place.

    If I hollow out an area by right clicking the tiles then, left click to start pathfinding it doesn't find it the first time but, if I click again it finds it.

    dropbox.com/s/vp6jwl6hb6f8jvt/PathfindTilemaps2.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • LazyBassTurd, Erasing tiles from tilemap is tile based so you could use something like this.

    Erase tile:

    floor(mouse.X/32)

    floor(mouse.Y/32)

    On right mouse released cannot be triggered under mouse pressed.

    Also I think it should only regenerate obstacle maps when they are modified and not every pathfind.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)