Jump to content

Unset static property in P2 physics


Recommended Posts



I experience that once a body in p2 physics has been set to static, then static = false has no effect.

The documentation says it should return to dynamic behaviour when static is set to false.


What I did:

take this example:




//  Make staticstatic1.body.static = true;static2.body.static = true;
static1.body.static = false;static2.body.static = false;
Still the bodies remains static. I'm using Phaser 2.0.5.
What am I doing wrong?


Link to comment
Share on other sites

It doesn't help.

I've tried with Phaser 2.0.7 as well.


If I set to static with motionState = STATIC and then I set it to DINAMYC it works, however, the static object's collision is not correct (the dynamic object penetrates the static object, then a force is applied to the dynamic body which tosses it away.

Link to comment
Share on other sites

I've found the solution: one has to restore the body's mass when setting static property to false, because the static body's mass is set to 0.

Should I create an issue, or am I expected to set the mass manually?

Link to comment
Share on other sites


  • Recently Browsing   0 members

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