Anyone else having issues with multi-tile trees on TileMaps that have NavigationPolygonInstances in them?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By batmanasb
:warning: Old Version Published before Godot 3 was released.

From what I understand, each TileMap node can only be on one layer, so I made bottom, middle, and top layer TileMap nodes for different kinds of tiles. But if I do something like put a tree trunk on the middle layer and the tree top on the top layer, the player can go behind and in front of the tree (which is good), but he can also stick his feet through the tree (from above), or stick his body between the top and middle layer tiles. He’s some pics of what I mean: good, good, bad, bad

Normally I guess I would put StaticBody2D nodes to block the top of the bottom tile and bottom of the top tile, but then that would break the Navigation, because I have to either have an entire tile be a NavPolyInstance or have no NavPolyInstance but a StaticBody2D instead.

Anyone else having issues with multi-tile trees/objects on TileMaps that have NavigationPolygonInstances in them?

:bust_in_silhouette: Reply From: batmanasb

Okay so I just took long hard look at the Isometric demo, and the answer to the Z sorting issue is basically automated by Godot already. The trick is to attach the character and mobs as children of a TileMap node, then enable the TileMap node’s Z-Sort checkbox. This will automatically allow the character to move in front of and behind trees! Except I’m not sure how well this works with normal tiles, but it works amazingly for isometric tiles, so I’m going to convert my game from normal 2D tiles to isometric.

Just to clarify, I’m pretty sure this only works well if all the mobs/objects you want to be Z-Sorted are on a single tile. So multi-tile trees don’t seem ideal, but I think there are tricks to get around that for things like forests.