I’m getting the following error: “NullReferenceException: Object reference not set to an instance of an object.” I get it for the line “roomBounds.max = Vector2.zero;” below. Am I setting something up incorrectly?
using UnityEngine;
using System.Collections;
public class RoomBounds {
public Vector2 min;
public Vector2 max;
public RoomBounds (Vector2 minRef, Vector2 maxRef) {
min = minRef;
max = maxRef;
}
}
public class RoomControl : MonoBehaviour {
private RoomBounds roomBounds;
void Start () {
roomBounds.max = Vector2.zero;
}
}