In my game, the player has the ability to shoot fireballs. This is done by a child of the Player. The child adds the fireball node as a child. The fireball refused to obey the YSort node that the player is in. Help.
the balls should be a child of the ysort for ysorting. a kine node does not sort their childs. also check the fireball sprite offset.
@Zelta I need the Player to be Kinematic. How could I solve this??
sorry my english. dont touch your player. i think you are adding the fireballs like player childs, that not work. just add the fireballs instances to your ysort node.
-ysort --player --enemies --fireballs --grass etc
@Zelta the player has a child called projectile manager, and the fireball is a child of projectile manager. So how would I add the fireball as a child of the players parent (the YSort) instead of the ProjectileManager?
just change the path
get_node("../../").add_child(your_fireball_instance)
@Zelta I can't do it like that because the fireball and player scenes have to be used in several different nodes, where the layout is different. They all do have a player that is the child of a YSort though. Is there any way to just search for a node? or maybe use an if statement to see what scene it is in to decide the path?
sure, check this https://kidscancode.org/godot_recipes/basics/node_communication/
@Zelta tysm! all working now :)