Unable to see my scripted tile in my tile palette?

Hello!

I’m using this tutorial to make scripted tile so I can get a bit more flexibility than what the Rule Tiles provide. The problem is, after I create my tile and drag it into the palette, nothing is actually appearing there. That being said, if I delete the tile I just created, the pinkish placeholder tile image shows up in the palette, so the tile is actually being set, it’s just not visible.

At approximately 28:00, guy in the video sets the sprite of his tile and drags it in no problem, but I just can’t replicate his success. Would anyone know what could be the issue here?

You might note that Rule Tiles derive from TileBase and not Tile.

Tile has a sprite property and the Tilemap gets the sprite reference from that.

Basic rule tiles don’t have the Sprite property but have a field called m_DefaultSprite and this one assumes that the Tilemap code knows this or there’s some other sort of adaptation (it’s opaque in the C++ engine so we can only guess).

The palette view is actually a Scene with a Tilemap in it.

So if your tile isn’t showing a sprite but it is there then that’s probably because when you created the rule tile asset you didn’t poke the default sprite into the field in the asset (in the proj folder).

My best guess at the moment w/o any other info.

Good luck!

Thanks for the answer!

Are you referring to dragging the sprite into the sprite field in the tile asset’s inspector window? If so, I did do that to no avail unfortunately!

Hi, it is likely that in TileBase.GetTileData of your custom Tile, the Sprite is not filled or set to null. Could you share how you fill in the Sprite for your Tile?

This was it! I set the sprite to the first of the sprite array and it works now. Thank you!

Tile has a sprite property and the Tilemap gets the sprite reference from that.

Basic rule tiles don’t have the Sprite property but have a field called m_DefaultSprite and this one assumes that the Tilemap code knows this or there’s some other sort of adaptation (it’s opaque in the C++ engine so we can only guess).

The palette view is actually a Scene with a Tilemap in it.

So if your tile isn’t showing a sprite but it is there then that’s probably because when you created the rule tile asset you didn’t poke the default sprite into the field in the asset (in the proj folder).

Can’t understand can you help me with it.