Код: Выделить всё
for (int i = 0; i < SpawnedChunks.Count; i++)
{
float playerX = Player.transform.position.x;
float chunkX = SpawnedChunks[i].bot_wall.position.x;
if (chunkX < playerX && chunkX > -4.5f && GameObject.Find("player"))
{
PassedChunks.Add(SpawnedChunks[i]);
PointsCounter.PointsCount++ ;
}
}

Подробнее здесь: https://stackoverflow.com/questions/787 ... stead-of-1