Jump to content

Check overlap with a specific tile


Recommended Posts


If I have a tilemap with a dynamic layer, a player with collisions enabled with this layer - how do I manually check whether the player is overlapping specific tile?

I try this way:

scene.physics.add.collider(player, layer);


var tile = layer.getTileAtWorldXY(Xpos, Ypos, true);
console.log(scene.physics.world.overlap(player, tile));

.. but I always get False printed, even if selected tile is right behind the player. Same result with calling collide(), same result if tile's index is -1 or something else. What am I missing?


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...