Collision issue with polygonal body and Tiled map tiles

Hi,

Here is a video link of what kind of issue I am facing. When the right side of the character moves to the inner walls, it just goes through. However a different characteristic observed when the left side of character collides with the tiled wall from Tiled map editor.

How can this be fixed? Video link : https://drive.google.com/file/d/1nupxp_qzjgE-K0rgAtFuLV87Zw2r68Zr/view

Hi Ahmed,

The problem may be related how you manage groups.

From Corona documentation - Physics Notes/Limitations :

Display objects with physical bodies can, of course, be placed in different display groups for z-index layering purposes. However, if you need to detect collisions between objects in different groups, you should not move, scale, or rotate entire display groups independently of each other because of underlying Box2D functionality.

It is valid to move, scale, or rotate a series of groups in unison or lock-step as long as these groups maintain the same coordinate origin, angle, and scale. However, if groups are moved, scaled, or rotated independently of each other, the Box2D collision system will consider the physics bodies to be in their original state, not as they appear as a result of transforming the group.

This also applies to the physics.setDrawMode() “hybrid” and “debug” modes — even though these draw modes will suggest that the bodies have changed as a result of modifying the group, the collision system will still consider them to be in their original state.

We get better understanding of problem if you share with us your code or part of it:)

ldurniat

Hi Ahmed,

The problem may be related how you manage groups.

From Corona documentation - Physics Notes/Limitations :

Display objects with physical bodies can, of course, be placed in different display groups for z-index layering purposes. However, if you need to detect collisions between objects in different groups, you should not move, scale, or rotate entire display groups independently of each other because of underlying Box2D functionality.

It is valid to move, scale, or rotate a series of groups in unison or lock-step as long as these groups maintain the same coordinate origin, angle, and scale. However, if groups are moved, scaled, or rotated independently of each other, the Box2D collision system will consider the physics bodies to be in their original state, not as they appear as a result of transforming the group.

This also applies to the physics.setDrawMode() “hybrid” and “debug” modes — even though these draw modes will suggest that the bodies have changed as a result of modifying the group, the collision system will still consider them to be in their original state.

We get better understanding of problem if you share with us your code or part of it:)

ldurniat