Hello everyones !
I’m creating a menu but i have a problem, I’m trying to create a Text array for my credits screen but I don’t know how to create/using it.
So far I have tried those lines of code :
Names = new Text[6];
Names[0] = Names[0].getComponent<Text>();
This simply doesn’t work and print an error :
-NullReferenceException: Object reference not set to an instance of an object.
Names = new Text[6];
Names[0] = (Text)this.GetComponent(typeof(Text));
And this one just empty my array of Text in the inspector of my object when i launch it…
I don’t really understand why neither of these two small code don’t work.