Physics objects can't quite touch each other?

0 favourites
  • 3 posts
From the Asset Store
Everything is made via physics, Very simple code: 6 events only (3 for tank creation, 2 for controls and 1 for camera)
  • 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.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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)

  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)