I'm trying to create a script where the user can make inputfields and the add data to it and a other screen the name will be randomized on every click you do.
public void StoreName()
{
    foreach (var input in inputFields)
    {
        string name = input.GetComponent<InputField>().text;
        names.Add(name);
    }
    string result = "";
    foreach (string name in names)
    {
        result += name + "\n";
    }
    textDisplay.GetComponent<Text>().text = result;
}
 
     
    