I’m trying to load a piece of text from the assets folder of my project but I keep getting a Null Reference. I’ve been messing with it for a good few days trying to figure out why I’m not getting anything but I’m out of ideas. If anyone has any ideas on what I could change to make it work, they would be much appreciated. Thanks.
The problem area is on these lines here, map is set to be “Test Peon Controller” which is the name of the text file.
TextAsset mapData = Resources.Load(map) as TextAsset;
string text = mapData.text;