a53-416
a53-416

Reputation: 3965

TileMap's Cell Size property is not adjusting the grid of the tile map

I'm creating a simple 2d game using the Godot engine. I'm having trouble with the TileMap object. Here's what my Scene Tab looks like.

enter image description here

A Scene_One node is the parent of a single child TileMap node. When I click on the TileMap node, the Inspector window opens up:

TileMap Inspector Window

By default, the values of the Cell properties are 64 x, 64 y. My sprite is is too small for the grid. Here's a good look at the problem.

Sprites are smaller than the tileset grid

My images are smaller than what I assume is a 64 x 64 grid. [I don't know if this assumtion is correct.] So, I adjust the values of the Cell size properties in the Inspector for the TileSet to be (16, 16). Now it looks like this:

enter image description here

I save, hit Enter, but when I open up the TileSet Editor, nothing seems to have changed. I've tried this with different combinations of values for x and y, but can't seem to adjust the TileSet grid size.

Grid size probelm

I am a beginner Godot. Can someone please explain what I'm doing wrong? It's driving me crazy.

Edit: I've tried re-importing tileset.png without a filter, same result.

Upvotes: 1

Views: 2635

Answers (1)

uberflut
uberflut

Reputation: 150

You need to diferenciate between the cell size of the tilemap (this is grid) and the size of each tile on the tileset.

The tileset looks like a 16x16 so keep that as your cell size, but the tiles have a gap of another 16px between. You will need to set an offset so select the icon with the # and the magnet in the tileset editor

enter image description here

and Snap Options will appear on your inspector. There you can edit your step, offset, and separation. Mess with that and you will eventually get it right.

enter image description here

Upvotes: 1

Related Questions