I'm using Tiled, and the TileMap class to import it, using a Tile layer to draw tiles, and an Object layer to create static box2d objects.
I want to draw collectables with Tiled, with an object layer to detect collisions. I thought on using Event.BEGIN_CONTACT to detect the collision and remove the collectable's body fixture (b2.Body:destroyFixture), so the player goes through as if nothing was there, but still being able to detect the collision. What I found is that on events the World gets locked and I couldn't even try my theory.
Somebody knows the correct way of implementing collectables with Tiled?
Comments
Additionally even if you remove body on collision, there will still be a little knockback for character because of collision, to remove it, set isSensor = true to fixture, so character would pass through the collectible