kestorr Posted September 28, 2014 Report Share Posted September 28, 2014 Hello there. Im trying to use the addPolygon on the body of a sprite but it seems that after i do that, the body will not collide with others. game.physics.p2.enable(objecttr100x86Sprite);objecttr100x86Sprite.body.clearShapes();objecttr100x86Sprite.body.addPolygon( {} , -1, -41 , 47, 42 , -47, 42 , -47, 43 );objecttr100x86Sprite.body.velocity.y=10; So now this body is not colliding with others for some reason. Quote Link to comment Share on other sites More sharing options...
valueerror Posted September 29, 2014 Report Share Posted September 29, 2014 try:game.physics.p2.enable(objecttr100x86Sprite, true);and have a look at the polygon (that should be drawn then).. is it applied correctly? Quote Link to comment Share on other sites More sharing options...
kestorr Posted September 29, 2014 Author Report Share Posted September 29, 2014 Hey there. I have managed to fix this issue. The vertices were not applied correctly as you pointed out. Thanks for the reply. valueerror 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.