Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Drachenbauer |
for x in range(grid_size.x):
target_grid.append([])
grid.append([])
for y in range(grid_size.y):
target_grid[x].append([])
grid[x].append([])
for _z in range(grid_size.z):
target_grid[x[y]].append(null)
grid[x[y]].append(null)
I try to put another layer of nested layers for the z-axis.
but in the lines inside the z-for-loop i got the error:
Can`t index on a value of type “int”
What do i wrong
Change grid[x[y]] to grid[comment0-y].
Why you need to do this:
grid is an array
x is an index in the array which could be another array but is most likely an int
grid has is array with arrays in it
grid[comment0-y] gets array grid_x from grid and then gets array x_y from array grid_x
grid[x[y]] get array x_y from x which is then used as an index for grid which won’t work unless x is an array which according to your for loop it is a int so indexing will fail.
codelyok13 | 2022-03-22 18:13