Question by
Dawrybek · Feb 17, 2021 at 04:22 PM ·
c#instantiatetransform.translate
My transform its moving but it makes Instantiate in one place
The Code
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GenerateWorld : MonoBehaviour
{
public GameObject[] Blocks;
public Transform Generate;
public int WorldHeight;
public int WorldWidth;
void Start()
{
for (int y = 0; y != WorldHeight; y++)
{
for (int x = 0; x != WorldWidth; x++)
{
for (int z = 0; z != WorldWidth; z++)
{
Instantiate(Blocks[0], Generate.transform);
Generate.transform.Translate(0, 0, -1);
}
}
}
}
}
Comment