Godot Version
4.2.2Question
How can I tell a created object who created it, without specifying the path to the creator?
The creator object - enemy or the player. The object being created - projectile. Each object has its own scene.
The enemy object does not have a fixed path name and can exist in a huge number of copies.
The current view of the creation script, somewhere inside it you need to add a signal.
if !gun_animation.is_playing():
gun_animation.play("shoot")
instance = bullet.instantiate()
get_tree().current_scene.add_child(instance)
instance.global_transform = gun_barrel.global_transform