Godot .instance and preload

Godot Version

Godot 4.2.1

Question

So, the problem is the following. We have three scenes, “main scenario”, “player” and “punchAction”.
I made a variable and preloaded punchAction into player. Which returns a packed scene, that i am able to print. However, when i try to create an instance of this scene and assign it to a new variable. It return “non existent function in base PackedScene.”
Reading the error now, makes it look like godot is trying to call this function from the packedscene, in that case, it really doesnt exist…
Probably a newbie question, but i would be grateful for an explanation to this question. Thanks in advance.

1 Like

instance is for godot 3 iirc
use .instantiate() for godot 4 to instantiate a scene

1 Like

Thanks, it worked. Silly mistake…
I will have to check the documentation more from now on

1 Like