using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Barmovement : MonoBehaviour {
public Transform avatar;
public GameObject[] levelsArray;
public GameObject one;
public GameObject two;
public GameObject three;
public GameObject four;
public GameObject five;
void Start()
{
levelsArray[0] = one;
levelsArray[1] = two;
levelsArray[2] = three;
levelsArray[3] = four;
levelsArray[4] = five;
}
void Update()
{
spawn();
}
void spawn()
{
int randomnum = Random.Range(0, 4);
Instantiate(levelsArray[randomnum], avatar.position, Quaternion.identity);
}
}