Hello,
I am making some simple test code to make random tiles appear upon play. I have looked over this code several times and for the life of me cannot see what is generating all these compiler errors. The first in the list is error CS1513 } expected on line 22.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Agog : MonoBehaviour
{
[SerializeField]
private Transform wallPrefab = null;
[SerializeField]
private Transform wallPrefab2 = null;
[SerializeField]
private Transform wallPrefab3 = null;
[SerializeField]
private Transform wallPrefab4 = null;
void Start()
{
public int[] array2=new int[4];
array2[0]=wallPrefab;
array2[1]=wallPrefab2;
array2[2]=wallPrefab3;
array2[3]=wallPrefab4;
int ycount = Random.Range(1,5);
int xcount=Random.Range(1,5);
int a=0;
int 1choice;
int 2choice;
int 3choice;
int 4choice;
int 5choice;
int 6choice;
int 7choice;
int 8choice;
if(ycount==1)
{
1choice=array2[Random.Range(0,array2.Length)];
Instantiate(1choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(ycount==2)
{
2choice= array2[Random.Range(0,array2.Length)];
Instantiate(2choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(ycount==3)
{
3choice= array2[Random.Range(0,array2.Length)];
Instantiate(3choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(ycount==4)
{
4choice= array2[Random.Range(0,array2.Length)];
Instantiate(4choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(xcount==1)
{
5choice= array2[Random.Range(0,array2.Lengt)];
Instantiate(5choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(xcount==2)
{
6choice=array2[Random.Range(0,array2.Length)];
Instantiate(6choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(xcount==3)
{
7choice= array2[Random.Range(0,array2.Length)];
Instantiate(7choice, new Vector3(1, 0, 0), Quaternion.identity);
}
if(xcount==4)
{
8choice= array2[Random.Range(0,array2.Length)];
Instantiate(8choice, new Vector3(1, 0, 0), Quaternion.identity);
}
}
}