Jump to content

Add Polygon (P2)


Conqarous
 Share

Recommended Posts

Hey, I'm trying to add a custom collision polygon for a hexagon.

I've measured the corners of my hexagon in illustrator:

28, 0
55,16
55,48
28,0
0,48
0,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

 Share

  • Recently Browsing   0 members

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