Question by
CaptCommunism · Apr 05, 2018 at 08:55 AM ·
arraypositionincrease
How to create a step by step array to inrease y position? 3D
Hallo,
i need help to increase a field of generated objekts step by step on the y axis. I want to start at 0 with the first row and increase the value row by row.
My script:
void Start () {
GenerateLevel ();
//trying to increase position
tempPos = transform.position;
transform.position = tempPos;
transform.position = new Vector3(transform.position.y, 5.0f, transform.position.z);
}
//generating objects
void GenerateLevel ()
{
for (int x = 0; x < map.width; x++)
{
for (int z = 0; z < map.height; z ++)
{
GenerateTile (x, z);
}
}
}`
Hope you can help me out
problem.png
(14.7 kB)
Comment