Tilemap position rendering SOLVED

Tilemap renders at origin of tilemap and not co-ords of game object it’s attached to along the x axis only.


i can fix this by editing the tilemap source and placing tiles in negative x though.

Also everytime I update the tilemap, in the collection it resets the Z to zero, again easily fixed, just annoying.

to solve the Z layer problem, I change the sprite’s Z layer and then it didn’t matter that the GO reset to 0 (although I have to say: it was a pain in the arse)

I’m not really sure I understand your problem. If a tilemap is a component of a game object it will inherit the transform of the game object. And you can set an offset on the tilemap component in the properties window to offset it’s position in relation to the game object.

Thanks @88.josh for the idea, I put the tilemap itself at 1, fixed my problem, @britzl, I’m still getting my head around Defold, love the engine, but it does have it’s quirks, so if I’m missing something forgive me,

Here’s the position of my tilemap, can clearly see the origin, if it has one that is.

Heres the position of my game object

Heres the position of the collection

Position of collection in Main

Position when running game

The only way I’ve been able to fix this is to add more tiles to the original tilemap in the negative x.

I’m clearly doing something wrong, but I’ve no idea what. :worried:

Hi @Davej!
Just as @britzl says, the tilemap component itself has an offset as well. If you open your “paralax_blackbush.go” file, select the tile component, you can see that it has position/rotation properties you can change. So you have full control to offset it inside the game object.

2 Likes