chearner Posted February 11, 2015 Share Posted February 11, 2015 I have a car similar to this demo...it uses P2 physics, CollisionGroup, springs and constraints to simulate the car body and two wheels. http://www.inkfood.com/create-a-car-with-phaser/ Question is how can I make the car "explode" or fall apart when needed? e.g. Collision with object or velocity is too fast, etc. I've tried to remove the springs or constraints but the car flies off the screen unpredictably. Optimally I would like to remove the spring/constraints and just have the 3 car pieces just tumble on the ground disconnected, or I could add random forces to the pieces to simulate a small explosion. Link to comment Share on other sites More sharing options...
chearner Posted February 11, 2015 Author Share Posted February 11, 2015 I spoke too soon...solved this by removing the spring and the constraint, in that order. Now I can add effects to these "pieces" to simulate a vehicle wreck. game.physics.p2.removeSpring(theSpring);game.physics.p2.removeConstraint(theConstraint); Link to comment Share on other sites More sharing options...
Recommended Posts