- Home /
Question by
Bruno_00 · Sep 05, 2021 at 02:58 AM ·
arraynullreferenceexception
Storing input Field Values in array not working
Hi Im New to coding i have tried asking a similiar question but it keeps going to page not found, anyway i have a bunch of input fields that i want to store the end edit values in an array, so i can access them easily. but every time i go to store them in the array it dosent work and give a null reference exception.
string[] dataStore; public void TitleCollector(string title) //attached to end edit on input box { dataStore[0] = title; // }
Comment
Answer by makaolachsiungca · Sep 05, 2021 at 04:50 AM
before you key-in variable into an array must declare the array at least once ( at OnEnable() or Start()) dataStore=new string[length you need]
Your answer
