Invalid get index '1' (on base: 'Array').

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Redical

I’m making a 2D Tower Defence game off of Game Development Center’s tutorial series: (This is part four, which is the part I’m up to)
And I’ve had a few errors, but I figured most of them out, except this:

Wave Functions

func start_next_wave():
var wave_data = retreive_wave_data()

func retreive_wave_data():
var wave_data = [[“BlueTank”], 0.7, [“BlueTank”, 0.1]]
current_wave += 1
enemies_in_wave = wave_data.size()
return wave_data

func spawn_enemies(wave_data):
for i in wave_data:
var new_enemy = load(“res://Scenes/Enemies/” + i[0] + “.tscn”).instance()
map_node.get_node(“Path”).add_child(new_enemy, true)

And every time I try to run the actual game it says:
Invalid get index ‘1’ (on base: ‘Array’).

Any ideas why is says this error? I can give more info if necesary. :slight_smile:

:bust_in_silhouette: Reply From: Redical

Haha, my problem was just I got the list wrong:
var wavedata = [[“BlueTank”] <— (Here’s where it’s wrong), 0.7, [“BlueTank”, 0.1]]
It was just meant to have the closing bracket after the 0.7.
Thanks for, well… nothing. I just made a silly mistake.