Continuing the discussion from C# line to Lua?:
I have been trying to use multidimensional arrays and I am unsure on how I would declare it at the start in this situation
In C#, I would have just declared it like this:
float[,,] array1
array1 = new float[30, 20 ,30]
In Lua, I have tried to replicate this but i believe i am not actually creating a multidimensional array but just a single one by doing this
array1 = {30, 20, 30}
So instead I found a way to create multidimensional arrays by doing this:
local array1 = {}
for i=1,30 do
array[i] = {}
for j=1,20 do
array[i][j] = {}
for k=1,30 do
array[i][j][k] = ?
end
end
end
The question mark is where I am confused though. I want to set the values like i was setting it in C# but this is only giving me one value to set.
It may just be not understanding multidimensional tables in Lua however.