Jump to content

Collision with sprite and tilemapLayer never calls collideCallback


Recommended Posts

In my game, this line:

game.physics.collide(player, layer["blue_wall"], blueWallCollisionHandle, null, this);

(Player is a sprite, and layer["blue_wall"] is a tilemapLayer)


blueWallCollisionHandle is never called.

I searched the collision function in the source, and I found that in the function collideSpriteVsTilemapLayer (in ArcadePhysics.js), this line:

if (this.separateTile(sprite.body, this._mapData[i]))

always return false, because separateTile don´t return a value, but set the value in this._result. And because of this, collideCallback isn´t called.

Link to comment
Share on other sites


  • Recently Browsing   0 members

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