Topic was automatically imported from the old Question2Answer platform.
Asked By
Bishop
Old Version
Published before Godot 3 was released.
Hi, I trying spawn…load player node by main script(autoload) with Globals
…location for the player works for me but player do’nt load to the level.
Thanks for help
Thanks very much,
first try didn’t work with both code sample.
I get error :
Parent node is busy setting up children, add_node() failed. Consider
using call_deferred (“add_child”,child) instead.
so I add call_deferred and this works…great but I get error
Parameter 'p_child' is null.... in this line : `get_tree().get_root().add_child(player_spawn)`
Ah, true… not simple having an instance in an auto-load script tbh^^
Then you can also remove get_tree().get_root().add_child(player_spawn) now, and also storing a second time player_spawn is not required: