Instantiated packedscene has no children

Godot Version

v4.6

Question

Trying to add an “objective” packedscene that has two child nodes, ObjectiveType and ObjectiveAmmount, into another node “Objectives” However, when instatiated the “Objective” scene the two children are null. Attached in the relevant code. Any help is appreciated.

Attached relevant code, let me know if more code/context is needed

Does your ObjectivesUI have any children? Are you sure you are loading the correct scene?


Make sure to paste code instead of screenshots

1 Like

I was calling the function that added children, but turns out it was actually working right, as ObjectivesUI did not have any children under remote

Turns out due to multithreading shenanigans, the function wasn’t on the main thread so add_child didn’t work. Called method on the main thread now it works fine.

I should read the debugger errors more often