Jump to content

Can you somehow debug were body.blocked[dir] comes from?


Recommended Posts

Is there a way to log were body.blocked.left comes from? The "other" Object? - which is unknown?

Explanation (why)
There is something wrong. But I don't know what - haha :D the best posts start with that sentense.

My character moves automatically and since body is blocked left || right he turns:
now there is no object in the level, just nothing and he turns on an invisible object all the time...

the behavior does even get stranger: if I let the character collide (on an placed object) in the other direction he would then pass the "invisible" object..
but if I then remove the "placed object to collide with", the invisible object seems to be there again (The invisible collision happens far of the placed object - it has nothing to do with it; I just placed it to see whats happening).

This does not happen there only. I've got another game using Tilemaps, done with tiled were this is happening too..
-> I completely debugged the TileMap data but there is no collision object on that certain points were this happens.

regards :)

Link to comment
Share on other sites

Hi Sam, you mean, where the body.blocked.left is set to true?

If so, you may try to place a breakpoint at:

1 - Phaser.Physics.Arcade.Body.checkWorldBounds: https://github.com/photonstorm/phaser/blob/v2.6.2/src/physics/arcade/Body.js#L795 or at

2 - Phaser.Physics.Arcade.TilemapCollision.processTileSeparationX: https://github.com/photonstorm/phaser/blob/v2.6.2/src/physics/arcade/TilemapCollision.js#L356

These are the only two places I found where blocked.left (or right) are set to something =]

Link to comment
Share on other sites

Thanks a lot, I found it and I debug what it is causing.. but that even more weird.
It is a tile, that is beneaht the character. I attached screenshot to few what I mean:
the red marked tile is
causing: blocked.left, which is ... a bug?
- All ground tiles that you see have the exact same Y coords. and they are all 40x40.
But when the character moves above the red marked tile, he would turn and blocked.left is true

regards :)


Link to comment
Share on other sites


  • Recently Browsing   0 members

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