Trying to make a game like the ZigZag type game, a endless runner.
This is how the scene looks like:
And this is me method on how to spawn tiles.
public class TileManager : MonoBehaviour
{
public GameObject leftTilePrefab;
public GameObject currentTile;
void Start()
{
SpawnTile();
}
void Update()
{
}
public void SpawnTile()
{
Instantiate(leftTilePrefab, currentTile.transform.GetChild(0).transform.GetChild(0).position, Quaternion.identity);
}
}
Which works it spawns 1 tile like this
How ever if I put the methos inside a for loop and try I assume it would spawn more tiles in a long row, how ever it just places the tiles inside each other and dosen’t form a line.