Tile layer won't render above player sprite?

So, I assume I’m missing something obvious. I have a number of tile layers (2D top down), and a player sprite. The depth of the player sprite is set to 5, the depth of one of the tile layers is set to 10… but the player appears in front of the layer as opposed to behind it.

Any idea what I’m missing?

this.player = this.physics.add.sprite(player.pos.x, player.pos.y, 'player', 3).setDepth(5);

        map = this.make.tilemap({ key: 'map' });

        var tilesField = map.addTilesetImage('field', 'tilesField');

        var tilesSpring = map.addTilesetImage('spring_summer', 'tilesSpring');

        layerBackground = map.createLayer('Background', tilesField, 0, 0).setVisible(false);

        layerForeground = map.createLayer('Foreground', tilesSpring, 0, 0).setVisible(false);

        layerCollision = map.createLayer('Collision', tilesSpring, 0, 0).setVisible(false);

        layerForeground.setDepth(10)

        rt = this.add.renderTexture(0, 0, 1280, 720);

:wave:

The depth code looks right, but all the tilemap layers are invisible.

You can try printing the display list contents:

Thanks! I’m not sure why my sleep deprived brain didn’t think to just switch setVisible. :expressionless: