I’ve made a basic chat that takes input from a message and displays it in a scrollbox. The thing is, I want all the messages in the box to be deleted after 10 seconds, I don’t actually want the user to be able to go back and read messages, and if there is no recent messages I don’t want people to have text on their screen.
Thank you, this was very helpful. One further question though if you don’t mind: Is there a way to do it to it based on when the message was created?
Example: 3 messages come in quick succession, as your code works it would be 30 seconds before the last of them is deleted, however I want their total lifetime to be 10 seconds each, so they all disappear together.
In that case it would be easier to script the disappearing act into the message itself. Each message should be a user widget (they already are, right?) So it can:
Another alternative would be to run a timer with a varying interval - the more messages there are, the more rapidly it removes them. But the earlier suggestion seems more inline with the ask.
Ah beautiful, after how hard it was to get the text to match the player material colour I didn’t expect it to be this easy. But thank you. Works perfect.