Issue with Inheriting YSort on PathFollow2D

Godot Version



I have a hierarchy like this:






The Game node has YSort enabled which Y sorts the Player and any other nodes in it correctly.
The ChildSprite2D has the same y position as it’s PathFollow2D which always has the same y position as the Player node as I need the Path to follow where the player goes.
When the ChildSprite2D moves along the path and ends up higher than the PlayerSprite2D it does not draw the ChildSprite2D behind the player.

Is it possible to make the ChildSprite2D inherit the YSort of the Game node so it YSorts with the PlayerSprite2D instead of always drawing on top?

var new_mob = preload(res://mob.tscn).instantiate()
%PathFollow2D.progress_ratio = randf()
new_mob.global_position = %PathFollow2D.global_position

this may be personal preference but what you want to do is set the global position of the sprite then add it as a child of the game node, not as a child of the pathFollow2D, other than that if you enable y sort on the childSprite2d it should also y sort. I’ve found that even if you enable y sort on the base node you sometimes have to enable it on the other nodes in the scene as well.