Is there a way to make Y-Sort work for sub-nodes grouped in another node?

I have a “level” node and player node is it’s direct child. However when I spawn enemies I keep them under “Enemies” node. I know that if I’d add enemies to “level” node y-sort would work correctly - but is there a way to make it work with that grouping node in between?

Y-sorting works only for children nodes that share same parent. You have to redesign placement of player and targets if you want to use default engine’s Y-sorting. To group you can use node groups (.add_to_group(&‘group_name’)).

1 Like