Conqarous Posted November 17, 2015 Share Posted November 17, 2015 Hey, I'm trying to add a custom collision polygon for a hexagon.I've measured the corners of my hexagon in illustrator:28, 055,1655,4828,00,480,16 When I try to implement it:game.physics.p2.enable(hexagon, true);hexagon.body.clearShapes();hexagon.body.addPolygon( {} , [[28,0],[55,16],[55,48],[28,0],[0,48],[0,16]]);The collision polygon is not visible at all (in debugger). I've never tried adding a custom polygon so I have no idea what I'm doing wrong.Thanks. Link to comment Share on other sites More sharing options...
Conqarous Posted November 17, 2015 Author Share Posted November 17, 2015 Ok, googling helped: coordinates must be counter-clockwise from bottom right. For some weird reason after adding polygon the anchor point gets messed up. Link to comment Share on other sites More sharing options...
Recommended Posts