[PAID PLUGIN REQUEST] Enable/disable collisions for individual tiles on TileMap

0 favourites
  • 9 posts
From the Asset Store
Piano tiles
$9.99 USD
Template for a piano tiles game, fully documented in comments and video
  • I need to enable/disable collisions in runtime for individual tiles. For example: there is a long river made with the same water tile. Water tile has its collision polygon enabled. I need to create a bridge to walk across the water, but I can't replace the water tile with a different tile ID. I need to keep this tile in place, but disable its collision. The rest of the river tiles should have their collisions enabled.

    Is this addon possible?

  • This is a good idea.

    Since tiles are referenced with a number, and the collisions can be disabled/enabled with a flag, i dont understand why its not yet implemented native...

  • Just a random try

    1.) Add a transparent Sprite on top of the water tile where you want to disable collision(size should be little less than size of tile otherwise it will interfere with neighbor tiles). Where you are using "collision for water tile" ,add another event "Sprite not overlapping water tile".

    I may be wrong 😂

  • Im sure dop2000 knows how to work around it, but it shouldn't be needed.

    "Work arounds" like that might be good in a small project, but with bigger ones, things get messy with "work arounds" + "work arounds"...

    You can remove collision per tile manualy these days, so i don't understand why we could not disable it via events.

    A good rule is: "Every setting you can change manualy, you should be able to change on runtime with events. (-browser restrictions of course)

  • Yeah, it's for a big project with huge complex tilemaps. Spawning sprites is not an option, unfortunately.

    I found another workaround - I generate a temporary local obstacle map around the character when it crosses the bridge, and disable collisions with the main tilemap using solid collision filters. But a plugin allowing to disable tile collision would make this job much easier.

  • Another workaround would be to use 2 tilemaps, one for visual representation, another invisible one for obstacles (with a single obstacle tile in the tileset).

    You could then rebuild the collision map on layout start or tilemap creation by iterating through each tile and testing for collision (slow) or defining obstacle according to tile IDs (fast). And then, remove obstacle tiles by iterating through bridges and what not.

    Here's a crude exemple : drive.google.com/file/d/18kc2dI-WpgbQXATVs-NWX4H_GTBHdnyV/view

  • That's how I originally did this. However, like I said, the tilemaps are large and complex, and updated often. Many tiles have custom collision polygons, many tiles have disabled collisions. Maintaining cloned copies of these tilemaps just for collisions will be difficult.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I delved a bit in the source code of the tilemap, and I don't think it's reasonable to have a plugin to do that. The collision engine is deeply rooted in the C3 core and most of its code is external to plugins.

    I think it would be better to have Scirra officially support this. Maybe by adding a new tile state to its mask (i.e. collision disabled flag) ? A tile state already flips the collision polygon accordingly, maybe a new state to entirely remove the polygon for said tile is easily feasable ?

  • Magistross Thanks for the info!

    I posted this idea on the suggestions platform a few months ago, but it will never get enough votes to be considered by Scirra..

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