Godot: Placing a rotated tile in GridMap deletes the adjacent tile

Created on 27 Feb 2019  路  5Comments  路  Source: godotengine/godot

Godot version:
3.1 beta 8

OS/device including version:
MacOS

Issue description:
Placing a _rotated_ tile next to an already-placed tile on a GridMap causes the already-placed tile to disappear.

Steps to reproduce:
Open the project and the TestLandscapeGrid scene...

Given this setup:

screen shot 2019-02-27 at 3 33 31 pm

Try taking the selected tile and placing it here:

screen shot 2019-02-27 at 3 34 14 pm

Everything works fine. Undo that placement. Press s once to rotate the tile and then try placing it as shown here:

screen shot 2019-02-27 at 3 35 24 pm

When you click to place it, the adjacent tile disappears, as shown here:

screen shot 2019-02-27 at 3 36 07 pm

Minimal reproduction project:

ufo_test.zip

archived editor

Most helpful comment

if Godot can or should support a way to work with those tiles

That's pretty much what #24602 is asking for. If we could change the mesh's pivot in the engine itself, this would be pretty easy to do (e.g. using an import script). Right now, I don't think there's anything you can do in Godot itself to fix it...

All 5 comments

This is not a bug. Your tiles have their pivot set in the corner (as is the case for all Kenney tiles by default). Thus, when you're rotating the tile, it appears as if its moving to neighbouring tiles since you're rotating around its pivot (its corner) and not the actual center. So even though it visually looks as if you're placing it in the same spot in both cases, you're actually overwriting the other tile's data when you're trying to place the rotated tile. This is basically the same problem as people are having in #24602

Interesting... that makes sense, but then suggests that it would require a lot of pre-Godot work with the Kenney tiles to make them usable in Godot. That's not the fault of Godot, of course, but makes me wonder if Godot can or should support a way to work with those tiles (or other assets with a similar problem) short of having to open all of them in Blender and re-export them. Or is there another way to quickly change a set of tiles in Godot?

if Godot can or should support a way to work with those tiles

That's pretty much what #24602 is asking for. If we could change the mesh's pivot in the engine itself, this would be pretty easy to do (e.g. using an import script). Right now, I don't think there's anything you can do in Godot itself to fix it...

@clayheaton you can write blender scripts to do what you're asking

Closing then as it's not a bug. 3.2 has support for applying an offset to OBJ files on import, particularly relevant for Kenney's notoriously offset meshes.

Was this page helpful?
0 / 5 - 0 ratings