Physics objects can't quite touch each other?

Get help using Construct 2

Post » Fri Aug 14, 2015 5:51 pm

I just started working on a new physics based project, and I noticed that the physics objects, when pressed against each other, don't quite touch, as if there's an invisible 1 pixel wide force-field separating them. It doesn't appear to be a rendering issue, as when I set the layout zoom to 4x, the gap increases proportionally, becoming about 4 screen pixels wide.

In older projects physics collisions appeared perfectly accurate up to 10x zoom, much less 1x.

I don't recall ever seeing this happen in any prior projects.
I now can't get precise collisions to work in any new projects.

Is there something that changed in the physics behavior, or is there a setting that might help?
Any thoughts or suggestions welcome.
B
26
S
17
G
8
Posts: 323
Reputation: 6,021

Post » Fri Aug 14, 2015 6:48 pm

maybe your collision polygon is slightly off...

or maybe try the old Box2d web physics engine instead of the newer asm.js (or give Chipmunk Physics a try)
B
94
S
33
G
20
Posts: 438
Reputation: 17,615

Post » Sat Aug 15, 2015 3:21 am

Thanks for the reply @AllanR, :)

I double checked the polygons but they were just bounding squares around objects that are squares. The individual vertices are all at integer coords, so I don't think the polygons are off. Likewise if I actually just set all the objects to bounding box collision mode (rather than polygons) I get the same gap.

Setting the collision mode to circles seems to produce the nearly perfect collisions I recall from older projects, but unfortunately, my objects are not all circles, so that's not really a long-term solution. :)

The "web" version of Box2d does seem to be quite a bit better with a gap about 1/4th or less than the size of the "asm.js" version.

It almost seems like the collision poly lines themselves have some kind of line-thickness.
B
26
S
17
G
8
Posts: 323
Reputation: 6,021


Return to How do I....?

Who is online

Users browsing this forum: blissfulwizard and 11 guests