Hey there !
I’m having a little bit of trouble with my polygonal physics objects.
I’ve got a newPolygon object, which is created like that :
local customShape = { 0,-37, 37,-10, 23,34, -23,34, -37,-10 } local pentagon = display.newPolygon(0,0, customShape) physics.addBody( pentagon, "static",{ shape=pentagonShape, density=3.0, friction=0.8, bounce=0.3 } )
Unfortunatly, it seems to create a “hollow” object : if a small object gets in collision with it, there’s a chance it gets through it and gets trapped inside of it. In the hybrid view, it gives me something like that :

So, the first shape is my pentagon. The second shape is a triangle, but instead of using newPolygon, I’m loading a picture (or creating a circle, both work) and applying a custom shape as a physic shape. As you can see, the triangle is “full” while the pentagon is “hollow”.
local triangle = display.newRect(0,0,100,300) local triangleShape = { 0,-35, 37,30, -37,30 } physics.addBody( triangle, "static", { shape=triangleShape, density=1.6, friction=0.5, bounce=0.2 } )
Is it possible to create a newPolygon, using its coordinates and then applying it as a physic shape so that it gets “full” ?
But if needed, the right code is :