How do I know why instanciate on a PackedScene fails?

Godot Version

4.3 beta 2


I have a packed scene. when I call the _packed_scene.instanciate() in the debugger, i see a property of the scene being set; however the instanciate() function returns with null. no error message is printed.
when i try to do it at the very beginning of the _ready function of the main scene, it suceeds. I thought the packed scene may have been corrupted so i reloaded it just before calling instanciate(), that didn’t help.
** how do i figure out what’s wrong?**

Maybe you spelled it wrong, it’s instantiate()

1 Like

Hover over the method name and click on it while holding down the CTRL key. You should be redirected to the method definition. I don’t know about an instanciate() method but I do know that the PackedScene class has an instantiate() method.

turn out the problem was not the instantiate() but rather the down cast done in the same statement. investigating.
thanks for your advice.

1 Like