godot 2d array

Solutions on MaxInterview for godot 2d array by the best coders in the world

showing results for - "godot 2d array"
Marie
26 Jul 2019
1#creating 2D Arrays in GDscript
2var my_array = [[]]
3
4var width = 5
5var height = 5
6
7func _ready():
8	#setting 2D Array size
9	for x in width:
10		my_array.resize(width)
11    
12		for y in height:
13			my_array[x].resize(y)
14          
15	#setting a value
16    my_array[0][0] = 1
17