Removing tiles from tilemap updates collision shape but does not affect objects at rest (DEF-3810) (SOLVED)

Encountered similar issue (kinematic and dynamic collision objects interacting with static tilemap).
OS: Windows 10.
Defold: 1.2.146

Reproduce:

  1. Allow kinematic/dynamic collision objects to reach steady-state on collision tile. (e.g. player or object landing on tile)
  2. set_tile() sets the tile to one not included in the collision mask.
  3. kinematic/dynamic object remains at rest.
  4. Initiating movement on the kinematic object recognizes updated collision mask, but only when the contact normal vector changes/is refreshed (verified through physics debug view).

e.g. moving away and then re-initiating contact with where the ghost tile is will respect the updated collision mask. Moving laterally to the ghost tile will cause the collision to persist.

IMHO this limits potential for using dynamic tilemaps during gameplay.

@britzl downloaded 1.2.147 and reproduced my issue in post #6.
Post #6 highlights a more subtle issue and may need a new DEF- bug.

It refers to using a tilemap already instantiated in the main collection, and calling set_tile() to replace a collision mask tile with non-collision mask tile.

The collision mask does update, but the existing contact point normal vectors persist until the colliding object has been moved away.

i.e., set_tile() does not remove physics contact points.

I suspect the same bug may apply to factory-spawned tilemaps.

@jhonny.goransson, what are your thoughts on this?

Yeah hm, sounds like a different issue to me. I’ll take a look

1 Like

Yes, it’s definitely a different issue because my issue is now fixed.

1 Like

I managed to get a project for the issue that @0xfe was talking about. When a dynamic object collides with static tiles that are set up to collide with it and then the tiles are changed with others that shouldn’t collide with the object, the object remains still even if it should fall through. I also tried with a kinematic object with simulated physic from the platformer example, but it worked correctly for what I have tested.

Attached project here:

Collision bug 2.zip (51.1 KB)

To use the kinematic physic just change the collisionobject type to kinematic and check the use_kinematic property on hero script.

Hi @jhonny.goransson, were you able to see the issue re: post#8?

I’ve created a ticket DEF-3810 so that we can hopefully have time to investigate it this sprint.

We have a fix in the pipeline now for this issue, expect it to be available in the next release :slight_smile:

7 Likes

Fixed in 1.2.149

1 Like