TileMap, TilePallete, Anchor weirdness(or misunderstanding)

6210731--682487--upload_2020-8-16_22-49-27.png

When I drag-drop my sprite onto the tile pallette, I get this, a bunch of misaligned sprites.

I have set tile anchor of both my tile pallete layer and the one on the tilemap to (0; 0; 0)

How do I fix/remedy this weirdness, and what’s going on?

This could just be a sprite pivot problem. Go to the Sprite Editor and check out the pivot points for your sprites. Are the center? You probably want center.

If this is also a scaling issue, make sure your textures have the correct Pixels Per Unit. If your sprites are for example 64x64 to have them occupy 1 tile they need a pixels per unit of 64. Each tile is 1 unit in size, so long as you’re not using a funny scale or grid settings. If that doesn’t work, try recreating the Tile Palette and pay special attention to when it prompts you for the settings of the palette and make sure those match your desired settings.

1 Like

@Lo-renzo

My scale is set to 1 1 1, and sprites are 16x16.

The pivot is indeed center.

I have tried re-creating the palletee at least 2 times before, and it did not help.

What happens if you drag into sprites one by one instead of the whole spritesheet?

Load a different tile set into the tile palette, then switch back to this one. Helped me once.

When the Sprites have a pivot at the center and placed on a Tilemap with an anchor of 0, 0, 0 (this corresponds with the lower left corner of the Cell), the Sprites will be arranged with the pivot at the anchor position. This is what you get in your first screenshot.

Assuming that you want to align the Sprites within the Cell, you should have a lower left pivot for your Sprites or set the Tile Anchor to 0.5, 0.5, 0.

Many thanks!

Actually…

I want the Sprites to both align with the cell, and have rotation axis through their center, cause currently if I try to rotate a Sprite it looks derpy and can go into other cells…

to clarify:

I want a Sprite with transform coordinates (0, 0) be display inside the cell, the cells be aligned with the tilemap grid visually, and to be able to rotate Sprites with pivot in center

It sounds like setting the Sprite pivot to center and setting the Tile Anchor to (0.5, 0.5, 0) would generally fit what you need visually.

Is there a particular reason for this?