I am trying to achieve a text based list of names that keep adding to the list as the player inputs more names to it in the input field, shown in the middle of the screen.
The names should appear below, as shown in the picture “Test”, and as the player adds a new name, that name appears in the list as well. Right now I have only one text block to show the player the last given index in the array that he entered to the input field, but I want the list to grow with more names as the player adds them.
Here is my code so far: The player writes a name in the input field, it goes to “player” array, the player array then shoots to existing text block below the input field to display the given name. Right now though, if the player adds a new name, the text block changes to the last index, just to show that it actually is taking items from the array.
My current problems with the code are:
-
The “print string” (log) does not print the length of my array to me in gameplay. I want to see how many items I have in my array just for troubleshooting.
-
I don’t know how to add/spawn a new text block as the player inputs a name in the field.