Jump to content

Physics bodies never come to rest on gravity collision.


Recommended Posts

Copied from https://github.com/photonstorm/phaser/issues/870


I have found that for Arcade and P2, if a body falls due to gravity and collides with anything (tilemap layer or world boundary), it never fully comes to rest. Instead it keeps bouncing imperceptibly. You cannot see this, the body appears to be at rest on screen. However checking body.velocity.y or body.speed will show it alternating rapidly.


I've done a plunk demonstrating this. Watch the velocity.y and body.speed variables in the debug.




From looking at the Phaser source, it looks as if velocity.y is always recalculated with gravity and there's not an easy way to check at that point if the body is blocked. Any advice?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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