I’m making a command line interface game, as the player types a command it gets added to the output window of the console, eventually the output window fills up and needs to scroll down so the player can see the new text that is added, here is my current script:
public void OutputText(string newText)
{
numberOfLinesInOutputField++;
if (numberOfLinesInOutputField >= maxNumberOfLines)
{
//textOutput needs to scroll down here, or to translate up, how can I do this?
}
textOutput.text = (textOutput.text + newText) + “\n”; //sets the text to the current text + new text + line break
}
I don’t want to use a scrollbar, the amount of text in the text box depends on the player’s input, this is my first serious project with Unity, so I’m still learning
Any help would really be appreciated
Thanks,
Fred T.A