Unable to initialize arrays or lists.
So I'm trying to make either an array or a list which would hold Vector2 elements. Those containers ideally would be able to be sent to objects. But I can't even get to that part. The arrays and lists refuse to initialize. For example:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Test : MonoBehaviour {
// Use this for initialization
void Start () {
List<Vector2> pathTaken = new List<Vector2> ();
}
// Update is called once per frame
void Update () {
}
}
This gives me "The thing you want to instantiate is null." Same with built-in arrays. This is a blank script attached to stationary wall object. What obvious thing am I missing?
There's nothing in that code that should give you an error.... Are you sure it's in this script, and that you've posted the script throwing the error?
Yup. Out of desperation I literally just tried to initialize it in a blank script just as above. That's why I'm posting here.
Can you copy-paste the entire error text, please?
Your answer
Follow this Question
Related Questions
2D Arrays Help. Why to use 2D arrays for 2 ints 2 Answers
[Quiz Game] How to prevent Question asked twice. HELP 1 Answer
Remove connection between lists or arrays 3 Answers
Need help with 3d inventory system 0 Answers
All GameObjects list to a GameObject? 0 Answers