Removing 1-pixel margins between physics objects stacked on top of each other?

I’m stacking several physics rectangle image bodies on top of each other, but in-between many of the images (which rest on each other, thanks to the physics default collision handling) there is a tiny gap. How can I get rid of this gap?

Thanks! [import]uid: 10284 topic_id: 3731 reply_id: 303731[/import]

This is interesting, I also have this problem sometimes! [import]uid: 11130 topic_id: 3731 reply_id: 11415[/import]

Any hints on this??? It’s been a while… :stuck_out_tongue: [import]uid: 11130 topic_id: 3731 reply_id: 13918[/import]

I “solved” this for my game with a workaround: instead of using a simple image rectangle shapes for these objects, I’m defining their countours as a polygon shape. The polyline I’m drawing is actually just that same box – but moved 1 pixel to the inside for every corner.

This means that as a result, the boxes will look like they’re actually always connecting. Potential downsides could be speed (I don’t know yet whether that’s an issue, in my brief comparisons I didn’t notice any new lag) or *too much* overlapping for some boxes (wasn’t a problem for me). [import]uid: 10284 topic_id: 3731 reply_id: 13938[/import]

PS: physics.setScale(…) also affects the gap, so it might be another value to play around with. [import]uid: 10284 topic_id: 3731 reply_id: 13964[/import]

Hmmm I’ll check these out!
Thanks Phillip! [import]uid: 11130 topic_id: 3731 reply_id: 14096[/import]

I got round this by having images which have ‘soft’ edges. A slightly smaller collision shape can help, too.

m [import]uid: 8271 topic_id: 3731 reply_id: 14107[/import]