How to make a child node appear in front of another?

Godot Version

4

Question

Hi! I’m a newcomer to programming and to Godot, having worked with Unity for the past 4 years (no coding though). I started taking the Learn GDScript From Zero lessons but wanted to start making something resembling a game alongside it. I found this tutorial for drag and drop that seemed to do what I needed and followed it; I only had to make minor changes for godot 4. I also didn’t do the last part because I don’t want my sprites to point in the direction they’re moving, but I believe this shouldn’t affect the overall effectiveness. It worked alright. The issue is that if I leave the dropping zones visible, the object I’m dragging will disappear under them when I’m testing. If I make them invisible all is fine, I drag and drop the object in the place I more or less know the dropzone is. I tried reordering the children nodes in the scene and putting the draggable object first like I would do with a layer in photoshop, but it didn’t change a thing. I suppose this has to do with the tutorial not taking Godot 4 into consideration but I couldn’t find anything about this in the comments, nor could I find other sources talking about this. I probably lack the knowledge of the proper names for things, sorry about that.

PS: I’m more than willing to try other methods of doing the whole drag and drop thing, I used this one because it seemed easy to follow and efficient.

Thank you for your help!

a few things would probably work you could either set it to top level or turn off show behind parent
Screenshot 2024-06-04 174246

1 Like

I’ll try that! The dropping zones are not parents, though, they’re all siblings. But I’ll check it out and see if it helps! Thank you!

It worked! Thank you so much! <3

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