vnen / godot-tiled-importer

Plugin for Godot Engine to import Tiled Map Editor tilemaps and tilesets
MIT License
850 stars 87 forks source link

Navigation objects are offset #118

Open alexkehayias opened 4 years ago

alexkehayias commented 4 years ago

Plugin version

Plugin version 2.3 downloaded from the Asset Library

Issue description

Navigation objects imported from Tiled are offset. When I turn on the navigation visualizer you can see the navigation area is offset compared to where the tiles are rendered. This is also the case when using pathfinding (which makes sense since pathfinding uses navigation nodes).

Screen Shot 2019-12-10 at 9 02 23 PM

Steps to reproduce

Create a tiled map and add navigation type objects to a tileset in Tiled and import into Godot. Turn on navigation visualizer in project settings.

Sample map or tileset

(let me know if you need this, would need to strip out the assets)

alexkehayias commented 4 years ago

I added in the offsets in Tiled which fixes it (although seems hacky).

Screen Shot 2019-12-29 at 10 20 02 AM
vnen commented 4 years ago

Looks like it's still a problem then. If you can provide a small map that reproduces the issues it would be great.

Frontrider commented 4 years ago

Just make a map in tiled, add a tile and an object layer and load it. All objects will show up 1 tile lower than they are in tiled.

Frontrider commented 4 years ago

That was with tiled version 1.3.2. I can't really read your code right now, so I don't know where that offset is.

Frontrider commented 4 years ago

@vnen Should I make a pr with my fix now (apply an offset of -1 tile on the y axis to every object) so you can check it, or should I try to get in some refactoring that may or may not succeed?

Worst case it could be a setting, like the json mode.