Why cant I do this? Incorrect number of values(terrain and array related).

Ok so I am trying to paint my terrain procedurally but it only allows me to use 4 terrain textures.

I cant increase it at all, it says “incorrect number of values”, whats happening? I tried adding more more heightstops but it didn’t work either. I tried many things, all failed.

Here is the code:

		float[] sStops = new float[2];
		float[] hStops = new float[4]; //This has to be same number as terrain textures.
		sStops[0] = 0.1f;
		sStops[1] = 25.0f;

		hStops[0] = Random.Range(0.01f,0.015f);
		hStops[1] = Random.Range(0.08f,0.58f);
		hStops[2] = Random.Range(0.37f,0.98f);
		hStops[3] = Random.Range(0.71f,1.0f);

		this.gameObject.GetComponent<TerrainToolkit>().TextureTerrain(sStops, hStops, dTextures01);

So recap: This code above paints the terrain with the 4 textures in dtextures01 but I cant increase it to more than 4? How could I do that?


Just watched an old tutorial and it says that you can add up to 6 but it also adds them in the inspector not in code. No idea if it helps but this is the tutorial.


That’s for textures but I’m assuming you need the textures in order to set at which height it applies those textures.
[1]: Terrain Toolkit - Tutorial - YouTube