# Rendering improper layers order

**URL:** https://phaser.discourse.group/t/rendering-improper-layers-order/15330
**Category:** Phaser 3
**Created:** [May 11, 2025, 1:44pm UTC](https://phaser.discourse.group/t/rendering-improper-layers-order/15330 "2025-05-11T13:44:29Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Toma](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/toma/32/8848_2.png) [@Toma](https://phaser.discourse.group/u/Toma)
#### Post date: [May 11, 2025, 1:44pm UTC](https://phaser.discourse.group/t/rendering-improper-layers-order/15330/1 "2025-05-11T13:44:29Z")

</div>

In Tiled, I have a mix of tile layer and object layers. Some of my tile layers are placed visually over object layers (so they should render over the objects), but when I load the map in Phaser, all tile layers get rendered first, and then all object layers get rendered on top, regardless of their order in Tiled.

Expected order:

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/4/495c86be910f5f95a77aecc98eeb2b00424f6a0d.png)

Parsed:

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/6/6f08ca6c37475ec8012cc414c663bcdf5ac87af1.png)

I think phaser is render first the layers and after the objects.

---

<div class="post-metadata">

### Author: ![Toma](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/toma/32/8848_2.png) [@Toma](https://phaser.discourse.group/u/Toma)
#### Post date: [May 11, 2025, 1:49pm UTC](https://phaser.discourse.group/t/rendering-improper-layers-order/15330/2 "2025-05-11T13:49:56Z")

</div>

Currently i made a json where I place an array with all layers/objects order and after map parsing I am setting depth based on the array index, but in future with lot of layers it would be hard to maintain.

---

<div class="post-metadata">

### Author: ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)
#### Post date: [May 11, 2025, 7:51pm UTC](https://phaser.discourse.group/t/rendering-improper-layers-order/15330/3 "2025-05-11T19:51:35Z")

</div>

Phaser renders tile layers only. If you use `createFromObjects()` then the new game objects are added to the end of the display list. But you can move them somewhere else or change their depth.

---

<div class="post-metadata">

### Author: ![Toma](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/toma/32/8848_2.png) [@Toma](https://phaser.discourse.group/u/Toma)
#### Post date: [May 16, 2025, 7:23pm UTC](https://phaser.discourse.group/t/rendering-improper-layers-order/15330/4 "2025-05-16T19:23:55Z")

</div>

Yes, finally I just assigned zindex to custom properties for each layer and objects.
