Find closest tile with collisions disabled?

0 favourites
  • 3 posts
From the Asset Store
Each tile 64 by 64 pixels - Ultimate Tile Set for your awesome games
  • Hi!

    Is it possible to check if a certain tile has it's collisions disabled in a tilemap?

    I'm trying to make a character drop something in the layout. But it should be dropped in a location which the player can access (so a tile on the tilemap that has no solid collisions so that the player can walk on top of it).

    I think I would know how to pull it off by checking for certain tile numbers that I know don't have collisions. But my tilemap has hundreds of tiles and creating this list would be tedious. So that's why I'm asking if there is a simpler way to find the closest tile with no collision turned on?

    Tagged:

  • The easiest way is to create a sprite, then in a loop move it to a random position and check if it's overlapping the tilemap. Once you found a position where it's not overlapping the tilemap - stop the loop.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you!

    I didn't realize that you can simply check for overlaps like this and it will automatically ignore the tiles without collision during that check!

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