charArray elements to each UI Text of letter objects

I have letter objects and each object has UI Text. The objects increase according string’s length (like at picture). Also the string converting to char array as random. So I want to put elements in char array to each UI Text of letters object as seperatly.

For Example: string is “answer”. Sure, char array will be (“a”,“n”,“s”,“w”,“e”,“r”). So Letter(0).GetChild(0).text will be “a”, Letter(1).GetChild(0).text will be “n”, Letter(2).GetChild(0).text will be “n” and it will go like this.

How can i do this? I hope I could to tell you in an understandable way.

Thanks

Not sure what the question is. :slight_smile:
Are you asking how to get : ‘a’, ‘n’, ‘s’ etc from the string? or something else?

@methos5k He wants to populate the text object on each Letter object. So that each box has a letter in it. From the looks of it, it’s a tap the letter to create a word type game. I was going to put something, just hadn’t had a chance.

Ya, I knew the part about getting the letter. Do you want the letter you click to be the next one in the index?
I feel like I half understand the question, sorry.

I did convert the string to char array. I want to put the char array elements to UI Text of GameObjects (named “Letter(Clone)”). I explain in detail already or my english too bad. Also are you old? I’ve seen you at my before question. you answered it and you was seem teen

My age is posted in my profile :slight_smile: Not sure how you thought I was young; young looking? talk like I’m young? :slight_smile: lol

So, you want to assign the character to text, like: “whatever.text = yourChar.ToString();”
You could also just do:

for(int i= 0 ; i < mystring.Length; ++i) whatever[i].text = mystring[i];

Sorry I couldn’t quite grasp the question.

Perhaps when @Brathnann has time he can answer, as he might have a better intuition about your question. :slight_smile:

** If my answer wasn’t helpful, that is.

Pretty much the code you showed was similar to what I was thinking.

Thanks a lot. I made it through your idea. :slight_smile:

for (int i = 0; i < letterArray.Length; i++) {
            letters [i].GetComponentInChildren<Text> ().text = letterArray [i].ToString().ToUpper();
        }

Cool, glad you got it sorted out. :slight_smile: