I am doing a Minecraft project using a YouTube video and I have typed this code in javascript:
var prefab : GridBlock;
var gridX = 5;
var gridY = 5;
var gridZ = 5;
var spacing = 1;
function Start ()
{
for (var y = 0; y < gridY; y++){
for (var x = 0; x < gridX; x++){
for (var z = 0; z < gridZ; z++){
var pos = Vector3(x,y,z) * spacing;
Instantiate(prefab, pos, Quaternion.identity);
}
}
}
}
and it says The name ‘GridBlock’ does not denote a valid type (‘not found’). I have set the prefab as a cube called GridBlock.