Godot Version
v4.2.1
Question
So I am new to Godot and I am trying to receive a signal from my “mob” scene in my “Survival_Game” scene. The node emitting the signal is “mobs” but I am not able to retrieve this node in my “Survival_Game” scene to receive the signal. I’ve tried many methods to try to get this node but right now it looks like this:
func _ready():
var mob_scene = preload(“res://mob.tscn”)
get_node("/root/mob/mobs").death.connect(self._on_death )
“death” is my signal and the function “_on_death” is what I’m trying to trigger with the signal. However, I get this error when trying to run the program:
E 0:00:00:0948 Survival_Game.gd:13 @ _ready(): Node not found: “/root/mob/mobs” (absolute path attempted from “/root/Game”).
<C++ Error> Method/function failed. Returning: nullptr
<C++ Source> scene/main/node.cpp:1635 @ get_node()
Survival_Game.gd:13 @ _ready()
Any help would be much appreciated. I haven’t been able to find my solution online so far.
Thank you