Failure to instance a scene

Godot Version

4.6.2

Question

This is the code for one of my nodes, and as you can see it’s supposed to instance the scene sight_bolt_1.tscn but it does not do that.

Instead, the first time the timer goes off it throws the error below at me:

image

And then, for every time after that, it throws the following error at me repetitively:

image

This obviously results in the scene not being instanced. If someone could help me figure out what exactly is going on here, that’d be gravely appreciated.

Right now you create one instance and try to add it as a child multiplie times.

Move line 8 into the bolt timer timeout, before add_child(instance), to create a new instance every time the timer fires it signal.

I’m not sure about the first error though.

PS: It would be better if you post your code as text, so people can copy and change it for an answer.

That seemed to do the trick, yes, thank you!

Also, I’ll remember the latter for the future

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.