- Home /
Trouble with MultiDim js arrays
http://www.unifycommunity.com/wiki/index.php?title=JavascriptMultiDimArrays
I put MultiDim.cs script in my standard assets > scripts folder. However it throws the error " BCE0005: Unknown identifier: 'MultiDim'."
http://img196.imageshack.us/img196/1946/25660129.jpg
The code using it (InitTerrain.js) is in StandardAssets/Scripts/MyTests Here is InitTerarin.js
var MapTerrainSizeX : int = 1 ; var MapTerrainSizeY : int = 1 ; //Total terrain size. Everything generated happens in here. var MapImageDiv : int = 1 ; //How big the image size of the game is. var MapImageBorder : int = 1; //How thick the game border is. Players can not move past this, however game occurs naturally from inside such as spawns var GameTerrainData : TerrainData = null; //Uses premade terrain data. Required.
function Start(){
Debug.Log("Start"); var GameTerrain = new GameObject("GameTerrain"); var t : Terrain = GameTerrain.AddComponent("Terrain"); var numbers = MultiDim.FloatArray(50, 60); //THIS LINE THROWS ERROR
t.CreateTerrainGameObject(GameTerrainData);
GameTerrainData.size = Vector3(MapTerrainSizeX, 1, MapTerrainSizeY);
}
Why is error being thrown? I've reread that page several times, I've googled and searched forum yet can find nothing wrong with it.
Answer by Daniel 6 · Jul 11, 2010 at 09:50 PM
Move your script (InitTerrain) out of the standard assets. But leave the MultiDim script in there because it needs to compile first.
Your answer
![](https://koobas.hobune.stream/wayback/20220613064418im_/https://answers.unity.com/themes/thub/images/avi.jpg)