0 votes

Hi all,

I have a TileSet in which some of the tiles also have a Sprite.flip_h=true version. I created this TileSet by creating a scene with a Sprite/StaticBody2D/CollisionShape2D for each tile, and then converting the whole scene to a TileSet (I don't know if this matters).

For each tile that should have two versions, I duplicated it and changed the Sprite.flip_h of one of them. In the Scene (later converted to a TileSet) everything appears as I'd like.

In a different scene, I added a TileMap and load the TileSet. The Sprites that should be flipped (those with Sprite.fliph = true in the TileSet) don't show flipped (ie. they appear as if Sprite.fliph=false)!

Any idea of what I may be doing wrong?

Thanks!

asked Apr 18 in Engine by TheVoiceInMyHead (32 points)

1 Answer

+1 vote
Best answer

That's because TileMaps don't use Sprites. They use TileSet resources which contain data - textures and polygons - and that's it.

The fact that you can use Sprites to create a scene that is then converted to a TileSet doesn't mean that the TileSet is going to have Sprite properties.

There is a button in the TileMap UI to flip a tile, or you can use the flip_x parameter of set_cell().

answered Apr 18 by kidscancode (17,704 points)
selected Apr 18 by TheVoiceInMyHead
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.