Tilemap with perspective draw effect, how would I go about removing the overlapping graphics?

This is a very specific problem but I figured it wouldn’t hurt to post, I think. ^^
I have made a tilemap with a fake-3D effect done on every placed tile using draw functions. The effect however has a problem when tiles are placed next to each other, and the effect overlaps.


How could I go about fixing that? Any ideas? Thanks for reading! I hope I am posting correctly

You might try setting y_sort_enabled.

How does that work? What should I do with it? Thanks for the reply!

Set it in the TileMapLayer, and it should sort the tiles by y before drawing them. That should make them overlap properly (or precisely backwards, in which case you may need to reverse it).

Sorry, but it appears to have made no difference at all. I have also tried drawing in reverse order, by reversing the placed-tiles array used in the code, but it just created different overlaps

Actually I am getting a warning, “a tilemap layer is set as y-sorted, but y-sort is not enabled on the tilemap node itself”, I’m a bit confused as to where should I find that option

With the TileMapLayer selected, check in Ordering. The third options says: Y Sort Enabled and is off by default.

Ahh, I have turned it on now, but while the warning has gone away, the overlapping is still taking place sometimes. Actually it seems to depend on the order I place the tiles! If I place them from bottom to top, the effect looks correct, but if I place them in the reverse other, the effect shows the problem… so weird


It appears whatever tile is placed last has priority in the effect, so if I could change them all to draw from right to left, bottom to top, I believe it would be fixed?