Arcade Physics and Custom Collision Boxes for TileMap

Hi,
I know this gets asked alot but I dont find any clear and definit answer in how to handle this with Phaser3. I use Tiled for creating my TileMap. The TileMap itself consists of two layers: one visual layer and one collision layer. With the standard Arcade Physics everything works as “expected” with the caveat that the collider size is the same as the tile size e.g 32px x 32 px. Unfortunately some tiles aren’t completly filled which means sometimes I need the collider to be something like 32px x 16px.

Simple question: Is this somehow possible with Arcade Physics or do I need something like Matter.js so that I can define collider sizes myself ?

Thank you !

1 Like

Hi,
You can’t change the body size of tiles.
I don’t know if matter can do this.
But another solution is to use 16px x 16px with arcade, so you can define the collision more accuratly

You can convert tiles to sprites with createFromTiles() and then resize Arcade Physics bodies.

1 Like

Thank you guys, I will try it.