chib Posted January 21, 2015 Share Posted January 21, 2015 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 More sharing options...
valueerror Posted January 22, 2015 Share Posted January 22, 2015 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 More sharing options...
chib Posted January 22, 2015 Author Share Posted January 22, 2015 I thinking it must be a bug as in the fiddle it seems to intermittently work, which is very confusing. Link to comment Share on other sites More sharing options...
Recommended Posts