welp, idk whats going on. My game don't run becuse of this erro "Invalid get index 'color' (on base: 'null instance')." somthing with color related, but i really don't know what to do. i'm doing like a candy crush game for a school project.
the code that is on error is this:
func spawn_pieces():
for i in width:
for j in height:
if !restricted_movement(Vector2(i, j)):
#choose a random number and store it
var rand = floor(rand_range(0, possible_pieces.size()));
var piece = possible_pieces[rand].instance();
var loops = 0
while(match_at(i, j, piece.color) && loops < 100):
rand = floor(rand_range(0, possible_pieces.size()));
loops += 1;
piece = possible_pieces[rand].instance();
the error is in:
while(match_at(i, j, piece.color) && loops < 100):
if somone know what's going on i will be thankfull.