Matter Sprite with vertices and center of mass - not fitting image

Hi there,

i’ve just tested the option for vertices of a sprite for better collision handling.
Looks good so far. I’m able to use vertices for the body collision. But now my image dosnt fit the collision box…
Left: Sprite in game with collision box from vertices, Right: sprite in editor (i’m using EasyPolygonMarker with transformation to vertices for Matter - see below data)

How do i get right of the “disposition” of sprite :slight_smile:

Here is the data for the sprite vertices:
“swamp”: [
{
“shape”: [ {“x”:119,“y”:211}, {“x”:110,“y”:242}, {“x”:95,“y”:246}, {“x”:74,“y”:246}, {“x”:38,“y”:216}, {“x”:25,“y”:193}, {“x”:22,“y”:171}, {“x”:26,“y”:134}, {“x”:43,“y”:118}, {“x”:49,“y”:76}, {“x”:91,“y”:18}, {“x”:137,“y”:9}, {“x”:240,“y”:34}, {“x”:262,“y”:56}, {“x”:267,“y”:98}, {“x”:259,“y”:129}, {“x”:217,“y”:163}, {“x”:204,“y”:163}, {“x”:164,“y”:188}, {“x”:145,“y”:193} ]
}
],

Maybe use PhysicsEditor?

Thx for the tip. But i found a solution :slight_smile:

        this.setOrigin( this.centerOfMass.x, this.centerOfMass.y );

:slight_smile: Works for me…