using UnityEngine
using UnityEngine;
public class BlockSpawner : MonoBehaviour
{
public Transform[] spawnPoints;
public GameObject blockprefab;
// Start is called before the first frame update
void Start()
{
int randomIndex=Random.Range(0, spawnPoints.Length);
for (int i = 0; i < spawnPoints.Length; i++);
{
if (randomIndex != i) //it says The name 'i' does not exist in the current context here and got confused
{
Instantiate(blockprefab, spawnPoints[I]); //here to
}
}
}
}
Without code tags, telling us what line the error is on makes things difficult. Don’t expect that we’ll count the lines.
However, simply put, your error is on the for declaration. Look closely at the end of that line and you’ll notice you have something extra.