Multiple Tilemaps and Y Sort

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

Hi

I have my player as a child of a tilemap and I use vsort so he can walk behind rock, etc.

Can I use 2 tilemaps in which a player Y sort through both.

The scenarios in which I want to use this for:

  • I have 64 tiles but also want to use 32 tiles for smaller objects
  • I want to layer a tile over another for small variances (e.g. fence and a bird on the fence, etc).

I can overcome these issues by setting up all tiles for all scenarios but it’s time consuming.

Is this possible?

:bust_in_silhouette: Reply From: quijipixel

As far as I know you can’t. YSort works only with its immediate children nodes, so having two TileMaps with YSort (or using a YSort node with the 2 TileMaps) won’t be a solution. For small objects you could use StaticObjects. This way you still can use the YSort functionallity. To make it easier, you should try the Asset Dropper plugin. This plugins allows you to easily add and move you objects to the scene.

The good thing of using the small objects as static objects is that if your player need to interact with them, you can do that. If those objects were tiles it would be rather impossible.