Here’s the code:
for i in range(spring_number):
var x_position = distance_between_springs * i
var w = water_spring.instantiate()
add_child(w)
springs.append(w)
w.initialize(x_position)
And every time i try to test it, Godot tells me: Invalid call. Nonexistent function ‘instantiate’ in base ‘GDScript’. ( ╯°□°)╯ ┻━━┻
I have no idea what to do abt it. Please help
Not too familiar with godot, but are you sure what you’re instantiating is a node?
It looks like godot is telling you that you’re trying to instantiate a piece of code. I’d try saving a node (with the script attached) and using that instead of whatever water_spring is.
As a note, including more context would help people help you.