Controls the order in which the nodes render. Hello all, I want to change the Z index value of my sprites according the Y position of each one. Download "SimpleRPG Map Tiles" map_tiles.png - 5 KB Add a StaticBody2D node as a child of Root and rename it Rock. The zIndex is the order they are laid out in the scene hierarchy. Issue with YSort not working with tilemaps. However, Godot will automatically add the node below the menu making hud take precedence. How . Properly using Y-sort with multi-layered isometric tilemaps? - Godot Forum ysort gdscript z The background and borders of the root element. mouse_enter signal not working · Issue #4645 · godotengine/godot · GitHub ZIndex not working in 2D - Godot Engine - Q&A So with following html. How to force Control Node "z-index"? Tree ordering not working - Godot In my opinion, doing this will solve most, if not all of the more basic z-index issues. Q&A for work. We can solve this in 3D with Sorting Groups. The stacking contexts have hierarchy, and each stacking context is considered in the stacking order of the parent's stacking context. Also make sure that each layer is offset from the previous by a significant enough of a number so that you have enough buffer in-between them precisely so you can add utilitarian nodes between in the draw order. UI Layout using Containers in Godot - GDScript Here is an actual case that requires the ability to change z order of menus. The solution is to use a CanvasLayer node as a parent to the UI. If I rig it so that when I hover the mouse over a Tile it prints the z_index of that Tile to the console. As of CSS3, this is no longer true. Issues with manual Sprite Sorting — Godot Forum Here, icon1 has its z-index set to 1. but it doesn't work! I have tried set z index () in code, and just setting the default z index at the root of each individual scene which I will be instancing, on the assumption they will be instanced with that z index. Maybe using a CanvasLayer would help, but then the "StatusBlock" element changes position according to viewport, not the Unit Node. Elements that are flex items or grid items can use z-index even when position is static. ZIndex not working in 2D. Godot Tutorial - Part 7: Using tile maps to create the game map To test StaticBody2D, first of all download the following image and import it in Godot (remember to turn off Filter in the Import panel). You can use Markdown in your post. From the specs: 4.3. Something like this should work when attached to the node, though I have not tested it: var canvas_rid = get_canvas_item() # You may need to adjust these values VisualServer.canvas_item_set_draw_index(100) VisualServer.canvas_item_set_z_index(100) Here's the documentation for the various functions: get_canvas_item; canvas_item_set_draw_index YSort + tilemap issue... — Godot Forum To see more, click for the full list of questions or popular tags .