Problem with Scene Tree Rendering Order

Godot Version

4.3

Question

Why does my player render behind the world scene?

All Visibility and Ordering options are default for all nodes, such as:

Z index is zero
Z as Relative is On
Y Sort is not enabled
Show Behind Parent is not On

I right-clicked the world scene and Instantiate Child Scene (player). I thought by being at the bottom of the scene tree, player should render on top of everything, but it’s not. You can see in the image, player is clipped by world.

Any suggestions appreciated.

Since your tilemap layers have a parent of type Node they do not have relative transform to their parent. Appearently godot first renders all nodes with a transform and their child nodes (else they cant be rendert obviously) and then checks for the remaining ones (children of Nodes without transform aka only of type Node).
So if you want to render them in correct order just use a Node2D:

Node2D (world)
|--Node2D (tilemap)
	|--TilemapLayer (ground)
	|--TilemapLayer (objects)
|--CharacterBody3D (player)
1 Like

Oh my gosh, that was it! I was pulling my hair out. The tutorials I’ve seen were using the deprecated TileMap and I was trying to figure out the right way to use TileMapLayers. I guess that was not it, but you’ve given me the key to get there.

Thank you!

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.