Jump to content

P2 Static Body can no longer collide after kill/reset?


chib
 Share

Recommended Posts

I'm developing a game which makes use of the P2 physics system.  I have a group of sprites with static P2 bodies which must collide with another sprite with a dynamic body.  This all works dandy until I call the .kill() method on one of the static bodies and then respawn it somewhere else via .reset(x,y).  After reseting it, it no longer collides with the dynamic body?

After hours of debugging I've figured out that if I make the bodies static then collisions still work after a kill/reset.  This doesn't help me that much however as I need them to be static.

I've made a jsfiddle to illustrate the problem:
http://jsfiddle.net/xdb9s6d1/5/ (NOTE: click the big boxes to kill/reset them)

Cheers!

Link to comment
Share on other sites

wow..  i tried everything...   resetting the position without reset and kill, reapplying the collisiongroups and much more..  nothing works.. i also tried repositioning without the clickhandler by using a game.time.event...

 

 the moment you set the body to static it can not be set to another position without losing collision..    

i also encountered that you can not set collideWorldBounds to false without losing every sort of collision.. maybe thats related..

 

this is a bug IMHO !

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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