0 Favourites

Confusion about collision on different layers

  • Hi there, I'm a little confused about the collision for tilemaps on different layers.

    I understand that if two tile maps are on top of each other, the bottom one has zero collision? This is the thing I am having trouble with.

    I am wondering if it is possible to have an RPG Maker-like tile setup where a layout has the "lower tile" layer and the "upper tile" layer- where the "lower tile" has water, mountains and such, basically filled tiles. Then the "upper" is decorations like windows, rocks stuff that has transparent pixels.

    I've tried to emulate this with having 2 layers, a tilemap with "lower tiles" on it and another one with "upper tiles." The problem lies with this "zero collision" . I will place water , mountains or buildings like that on the "lower tile" but because of this overlapping tilemap collision , my player can walk through those tiles like they are Jesus. I then think "well put the water/buildings on upper" but that also means that I wouldn't be able to put decorations on that like windows or water lilies because they are on the same tile map layer and overwrite each other!

    Is there a way to accomplish what I'm looking for? I'm not sure how to solve my issue.

    EDIT: for some reason a lot of words got removed in my post, fixed.

  • You could make a sprite, make it solid, and set it to invisible. You could us the same sprite repeatedly or use several depending on your collision shape needs. I don't make these type of games but seems to me this would work fine, placing the invisible sprites on the uppermost layer. I would also disable collisions on all visible tiles or sprites which would save memory. Hope this helps.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • You could make a sprite, make it solid, and set it to invisible. You could us the same sprite repeatedly or use several depending on your collision shape needs. I don't make these type of games but seems to me this would work fine, placing the invisible sprites on the uppermost layer. I would also disable collisions on all visible tiles or sprites which would save memory. Hope this helps.

    So if I understanding right, I would use an invisible sprite with solid to go over places in the lower part like water, buildings and etc. ?

    As for disabling collision on tiles, how would I do that?

  • Like I said, I don't make these type of games but, I don't know if there are collision properties on tile maps but, collisions with normal sprites will work fine, no matter what layer you place them on. I only mentioned disabling collisions on sprites that they are not required is just a good practice for performance. Normally you can disable collisions on the properties dialog box for every sprite. I assumed it was the same for tile maps.

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