Im trying to get text from a .txt file into a variable. The file is in the assets folder under Texts. Still i get bindata as null!
string instructions;
void Start ()
{
//LOAD TEXT ASSETS
TextAsset bindata = Resources.Load ("Texts/Instructions") as TextAsset;
instructions = bindata.text;
}
Nothing wrong with the code.Resources.Load() works only if the file is under Resources folder(or under any sub folder of Resources folder) under Asset folder.
Create a folder named ‘Resources’ under ‘Assets’.
Assets>Resources>Texts>Instructions