Question: I want to change the text of an instantiated button. This button is stored in an array.

But when I try to access the text component, I have issues. Can't understand what I am doing wrong, all sources I've been checking say the same as I did. Bored of uncompleted unity's doc...

Anyway, he is the code:

```
        foreach (string el in files)
        {
            AccountName = System.IO.Path.GetFileName(el);
            AccountsButtons[i] = Instantiate(Resources.Load("Account") as GameObject);
            AccountsButtons[i].name = AccountName;
            AccountsButtons[i].transform.SetParent(MyCanvas.transform, false);
            AccountsButtons[i].GetComponentInChildren(Text).text = AccountName;
         }

```

The last line, it tells me that `Text` is a type, and it's not valid in the given context (says Visual studio).

The error given by Unity's editor is:

```
error CS0119: Expression denotes a `type', where a `variable', `value' or `method group' was expected

```

Answer: 
Simply replace 

```
AccountsButtons[i].GetComponentInChildren(Text).text = AccountName;

```

with 

```
AccountsButtons[i].GetComponentInChildren<Text>().text = AccountName;

```

That's the [correct](https://docs.unity3d.com/ScriptReference/Component.GetComponentInChildren.html) syntax. If you have problems like these, you can always look in the Unity's [documentation](http://docs.unity3d.com/ScriptReference/) and that will help you out.
Try this:

```
AccountsButtons[i].GetComponentInChildren(typeof(Text)).text = AccountName;

```

The reason:

In C#, all constructors have to be instantiated. In the same way you can't just do something like `Vector3 vec = Vector3(0,0,0)`, you must append the `new` keyword to instantiate, so this would look like `Vector3 vec = new Vector3(0,0,0)`. In your code snippet, you seem to be referencing a class without any sort of instantiation or operator. To fix this, you must use the [typeof](https://msdn.microsoft.com/en-us/library/58918ffs.aspx) operator to pass the type as a parameter to your GetComponentInChildren method.