Godot Version
4.4
Question
Hello, I’m new to Godot, I hope this is an appropriate question.
I have a gameLevel (Node2D) scene. It has a player (CharacterBody2D) as a child. Additionally, I have a minigun (Node2D) scene.
The minigun is instanced to the gameLevel, and it needs information on player position. I have been sending information down the tree by calling a method of the child from the parent. However, not all gameLevels have a minigun. I would like to not modify my gameLevel.gd script each time based on if the gameLevel has a minigun or not.
What would be the best way to get that information from gameLevel to minigun, such that I can just drop the minigun into the level and not change any code on the parent script?