0
I’m doing a Voxel World Minecraft style in Unity 3D, but is giving the following problem: BCE0051: Operator '*' cannot be used with a left hand side of type 'System.Type' and a right hand side of type 'float'.
#pragma strict
var TamX: int;
var TamZ: int;
var Terreno: GameObject[,];
var Bloco: GameObject;
var x: int;
var z: int;
var AlturaMaxima = int;
function Start () {
Terreno = new GameObject[TamX, TamZ];
for(x=0;x<TamX;x++)
for(z=0;z<TamZ;z++)
Terreno[x,z] = Instantiate(Bloco,
Vector3(x*Bloco.transform.localScale.x,0,z*Bloco.transform.localScale.z),
Quaternion.identity);
Elevacao(0);
}
function Update () {
}
function Elevacao (seed: float)
{
var altura: int;
for(x=0;x<TamX;x++)
for(z=0;z<TamZ;z++)
{
altura = AlturaMaxima*Mathf.PerlinNoise((x+seed)/Mathf.Sqrt(TamX),(z+seed)/Mathf.Sqrt(TamZ));
Terreno[x,z].transform.position.y = Mathf.Floor(altura)*Bloco.transform.localScale.y;
}
}
I know the problem is on this line
altura = AlturaMaxima*Mathf.PerlinNoise((x+seed)/Mathf.Sqrt(TamX),(z+seed)/Mathf.Sqrt(TamZ));
Thank you very much!!
– Mikael