And to make clear why your solution did not work, if you use go.get_parent()
on main:/instance1#enemy
, you will not get main:/instance1
as a parent of enemy
, as enemy
is not a child object, but a component of the object. So the object you are addressing with main:/instance1#enemy
is main:/instance1
, and go.get_parent()
will try to find a parent of instance1
, which is nil
if it does not have a parent.
So keep in mind the difference between objects and components.