I have been struggling with this the past few days not sure what i am doing wrong. I am new to unity so if anyone could help explaing why i am getting these errors the solution and awareness so i can improve and avoid this situation again. I am trying to get three backgounds that are made to populate randomly together. I will list images and code.
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
public class RandomFromList : MonoBehaviour
{
public List roomList;
void Start()
{
GenerateRoom();
}
void GenerateRoom()
{
roomList = Resources.LoadAll(“Background”).ToList();
GameObject roomToBuild = roomList[Random.Range(0, roomList.Count)];
GameObject newRoom = Instantiate(roomToBuild, transform.position, Quaternion.identity) as GameObject;
}
}