Moving a tilemap (DEFEDIT-1652) (SOLVED)

I have a GO in which I have a tilemap. I want to move it, so I’m setting a new position of the parent game object - every child change its position in the Editor and then in the game, but not the tilemap! Changing tilemap’s position doesn’t affect its position, only the origin is moved in the Editor. By the way, in the tilemap editor there is no such possibility too :confused: I can only mark an area to copy it, but not move.

Is it a bug? Do we need a feature request for this? Or is there other way?

Can you post a minimal example of the not moving issue?

Possibly a camera issue? If there’s a camera attached to the same GO as the tilemap, the two would move in unison and thus seem to not be moving at all.

Mhm, I did, and in minimal project I actually can move it, so its a problem in my project :confused:

Yes, I do have a camera, from Rendercam, but it’s in other GO in the collection :confused:

It’s more like, I can’t even move it in the editor :confused:

I tried to restart, update Editor, I tried to move the tilemap to the different GO, delete it and add it again under the GO, but none of this worked :confused:

I’m trying to reproduce this but so far it’s all working as expected. I have a collection with a game object and a tilemap attached. In the collection view I expand the game object, select the tilemap component and use the move tool to move the tilemap. I see that the tilemap position changes in the properties panel and the tilemap itself is moved around in the scene view.

Please share a minimal setup where this isn’t working.

Ok, I will send a minimal repro, when I’ll by on computer, later this evening

Created DEFEDIT-1652. We will investigate today.

2 Likes

Looks like a problem with custom tile_foreground.material? Setting tilesource’s material back to default one made it move.

1 Like

Pity. I think for now I can switch back to a default material, but what is wrong with this one? Setting custom material for sprites doesn’t affect moving them in the Editor

Your tilemap material (tile_foreground.material) use the sprite fp and vp where positions are in world space. For tilemaps on the other hand you get a world matrix as a vertex constant and if you check tile_map.vp there’s this line:

mediump mat4 mvp = view_proj * world;
gl_Position = mvp * vec4(position.xyz, 1.0);

Since you’re using the sprite.vp/fp you ignore the world matrix which results in your tilemap always getting rendered at 0,0. Why not use the normal tilemap material?

It was just to draw tiles before some other tags like particles, when I didn’t actually know render script good enough, but well, yes, I can use normal tilemap material and yeah, then the moving is working fine, thanks! :wink: