This question might be stupid, but this is the first game I'm making and I really need some help.
I'm trying to make a puzzle game for connecting pipes. I put all of the needed buttons in array and when I run this program I get this on Debugger: Invalid get index '0' (on base: 'null instance')
And on errors: get_node: (Node not found: "arg" (relative to "/root/Node2D/Button").)
extends Button
var i=0
var arg=[]
func ready():
arg.resize(76)
while(i < 76):
var button = Button.new()
arg[i]=button
addchild(arg[i])
$arg[i].connect("pressed", self, "myrotate")
func myrotate():
arg[i].rotation_degrees+=90;