So I’m in the process of getting a chat system going for a game I’m working on. But I have an issue where, if there are too many lines in the chatlog (e.g. 31 lines of text when the Text gameobject can only fit 30) then the bottom lines won’t show up (so it shows lines 1-30, but not 31). How can I make it cut off the earlier lines of text instead (so that it shows lines 2-31 but not line 1)? Should I do something along the lines of (pseudocode):
if(characterCount > maxCharCount)
{
chalogText -= <all the text up to (characterCount-maxCharCount)>
}
The above would probably work, with some refinement, but is there a more efficient method?