|
|
|
|
Reply From: |
splite |
Edit: https://github.com/godotengine/godot/issues/28235
------------- original answer ---------------
The title of this question should be “Navigation with Tilemap has never heard about Pythagorean theorem”
The truth is, i dont know.
I tried your project and i dont see anything wrong (well, nitpicking, you ignore the fact that get_simple_path
is returning points relative to navigation2d node, so you should offset them to your tank space – but in your case, you dont have to, navigation offset to common parent with your tank is [0;0])
I recreated your project from scratch and have exactly the same problem:
Godot 3.1.0
(you can download it here)
Godot 3.0.6
Better but still not clean path
You can download this project here
@splite Thank you very much for looking into this!
I actually spoke with KidsCanCode on Discord, who’s the guy who made this tutorial. I’ve downloaded its source here from GitHub and opened the corresponding project, tiled the middle part of the map (there were some “holes”) and hit F5 to get the exact same kind of result:
tilemap_navigation_3.1 15_4_2019 21_18_52
Now if instead of using per-tile navigation polygons, I replace it with a single NavigationPolygonInstance
covering the whole navigable space, it behaves just fine:
tilemap_navigation_3.1 15_4_2019 21_16_59
(KidsCanCode told me he was curious and suspected a bug as well, and would take a look when he finds the time.)
Note that that project isn’t using the new Godot 3.1 Tileset editor at all, so it isn’t related to it.
I’m tempted to open an issue on the official GitHub and see what the Godot people tell me there. Do you think that would be appropriate?
Jeto143 | 2019-04-17 06:15
Yes, of course, they are nice guys + good thing is, you did your reserach first (you asked here). This is a great preparation for opening a issue.
https://github.com/godotengine/godot/issues/new
Try to make things clear & give them your minimal project (the one you posted here is great - btw, you can just drag&drop file to github issue), link this question (or send there link to your issue, i will repost my gifs )
splite | 2019-04-17 07:39
Ok, i was thinking, maybe we are doing it wrong - maybe you are supposed to have own NavigationPolygon and what you paint on your tiles is like “DO NOT WALK THERE” polys (so your walkable location is XOR between big NavigationPoly and small polys from tiles…
Or throw away the big NavigationPoly entirely - and you are walking “outside” of the tile navi polys.
Either way, what you paint on tileset is “do not walk here”. And if thats true, Godot team did a poor job telegraphing the idea.
Cant test it right now (dont have any free time )
Edit: well, i tested it and nope, doesnt work at all
Lets wait what guys say officially at your issue (worst case scenario is they tell us how to do it properly )
By the way, for capturing gif, i am using https://www.screentogif.com/
splite | 2019-04-23 07:55