Answer the question
In order to leave comments, you need to log in
Tiled generation not working?
Wrote this code:
private void GenerateTiles()
{
for(int i = 0; i < _tilesCount; i++)
{
if(i == 0)
{
_currentTile = Instantiate(_startTile, _parent);
}
else
{
var randomTile = _tiles[Random.Range(0, _tiles.Length)];
_currentTile = Instantiate(randomTile, _currentTile.EndPoint.position - randomTile.StartPoint.localPosition, Quaternion.identity, _parent);
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question