- Home /
How do you use MultiDim with JS?
How do you use the C# class MultiDim to create multidimentional arrays?
http://www.unifycommunity.com/wiki/index.php?title=JavascriptMultiDimArrays
I keep getting
BCE0005: Unknown identifier: 'MultiDim'.
and I'm not certain why.
Answer by Ashkan_gc · Mar 05, 2010 at 08:15 AM
as the developer said just create a C# script and copy the C# code of that wiki page to it. then you can use it in your scripts. if still you have errors copy the c# script to standard assets folder to prevent compiling order problems. the methods of the class are static so you don't need to create an instance of MultiDim.
var intarray = MultiDim.intArray(100,200,300);
it will create a 100X200X300 (3d) and puts the reference in intarray.
Figured out my mistake, I had placed it in the wrong folder :S. This is why coding at 3am is a mistake :)
Answer by MisterEd · Aug 26, 2010 at 12:51 AM
Can you make these arrays static as well? I use the same 'MultiDim' class.
static var gamersArr = MultiDim.StringArray(100,100); gamersArr[0,0] = "TestTekst";
If i try to retrieve the value, it stays empty. If i use it specificly in a script without static, it works just fine.
Im pretty new to unity so i must be doing something wrong....
Your answer
![](https://koobas.hobune.stream/wayback/20220612094954im_/https://answers.unity.com/themes/thub/images/avi.jpg)