0 votes

Hi, I need get size the array into another array(2d array)...Something like getsizerow
For example:

for i in range (myArray_get_size_row):
     for j in range(myArray_get_size_column):
         myArray[i][j]=rand_range(0,1)

Thank you

asked Jan 11 in Engine by estebanmolca (15 points)

1 Answer

+1 vote
Best answer

In gdscript I would do:

for i in range(myArray.size()):
    for j in range(myArray[i].size()):
        myArray[i][j] = rand_range(0, 1)
answered Jan 11 by dodgyville (134 points)
selected Jan 12 by estebanmolca

The only disadvantage is that you have to use a loop for, but it works ... I have to get used to using the arrays inside the arrays without thinking about arrays2D ...
Sorry for my english and thank you very much for answering.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.