Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotating or flipping tiles in tiled doesn't work when using collisiondata and Matter physics #6942

Open
hedgelot opened this issue Nov 13, 2024 · 0 comments

Comments

@hedgelot
Copy link

Version

  • Phaser Version: 3.86.0

Description

I am using Phaser with Matter physics. I use tiled to create tilemaps and add collision data/boxes in this software. When flipping or rotating the tile in Tiled, Phaser gives an error.

Example Test Code

const map = this.game.make.tilemap({
    tileWidth: 16,
    tileHeight: 16,
    key: "MyMap"
});
map.addTilesetImage("tileset", "tileset", 16, 16);

const layer = map.createLayer(layer.name, ["tileset"]);
layer.setCollisionFromCollisionGroup();

this.matter.world.convertTilemapLayer(layer)

Additional Information

This code works fine when using a map without flipped tiles, it also works with flipped tiles that don't have collision data on them. But as soon you add a tile with collision data flipped (or rotated) it stops working.
image

A workaround is to add all tiles in each orientation in the tile editor, but I hope this issue can be solved in Phaser to keep tilesets smaller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant