Sign in to follow this  
s4m_ur4i

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

Recommended Posts

Question
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 :)

Share this post


Link to post
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 =]

Share this post


Link to post
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 :)

error-collision.png

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.