I've got a character, and I can spawn his ghost if some conditions are met.
My code is the following:
var ghostScene = load("res://Scenes/Ghost.tscn")
var ghostInstance = ghostScene.instance()
ghostInstance.position = Vector2(position.x+32, position.y)
It's just for test purpose here and there's something I can't understand. If I only do add_child(ghostInstance) and do nothing about the position, the ghost will spawn as expected but will follow player's movement when inputting something (I can understand it since ghost would be a child of my character).
So my question is simple: why isn't it working when I try to instanciate the ghost at the same level as the hero? I mean, the print gives me the expected result, but right after if I try to check the position again, the node doesn't exist anymore. If I let the ghost as a hero's child, the instance isn't deleted... Why?