- Home /
Voxel terrain wont appear
Ok well when i Run this script in a object it wont create the voxels i need it to create for the base terrain. i will be making a generation code later but i just want to get the terrain out of the way. so can anyone help?
using UnityEngine;
using System.Collections;
public class MainTerrain : MonoBehaviour {
void awake() {
GameObject[,,] world = new GameObject[100, 100, 100];
for(int a = 0; a > 100; a++){
for(int b = 0; b > 100; b++){
for(int c = 0; c > 100; c++){
world[a,b,c].transform.position.y.Equals(a*10+10);
world[a,b,c].transform.position.z.Equals(b*10+10);
world[a,b,c].transform.position.x.Equals(c*10+10);
world[a,b,c].transform.lossyScale.x.Equals(100);
world[a,b,c].transform.lossyScale.z.Equals(100);
world[a,b,c].transform.lossyScale.y.Equals(100);
}
}
}
}
}
Answer by whydoidoit · Jun 18, 2012 at 07:24 PM
Well:
a) Your routine is called awake and not Awake - so it's not running.
b) You aren't creating anything anyway - you've created an empty array that can hold game objects, you haven't created anything in them.
You might be wanting to create cubes, see here for details on how to do that.
Your answer
Follow this Question
Related Questions
Ingame voxel terrain manipulation(sorry for last post) 2 Answers
Is it possible to remove part of a mesh? 1 Answer
Smooth Normals 0 Answers
Rounding edges of cubes (Voxels and Marching Cubes) 1 Answer
what has gone wrong with this script 1 Answer