- Home /
How do I increase string size over time?
I want my string to appear as nothing and then slowly animate itself to show more characters like a typewriter,
A > AB > ABC
as time goes on. So that rather than a message appearing all at once, it will slowly be revealed. I can't find anywhere that this process is explained. If someone could give me a hand it would really be appreciated.
Using C#
string str = "";
yield return new WaitForSeconds(0.1f);
str += "A";
yield return new WaitForSeconds(0.1f);
str += "B";
@DajBuzi, post answers as answers not as comments mate :)
You appear to know what string concatenation is, and how to delay script execution. :-) What is the problem you have?
The problem is that I want to pre define a message $$anonymous$$g. "Hey, come over here!" but I want it to slowly be revealed "H", "He" etc. I then want to change the message according to another part of the script, so that the message will then appear "I'm glad you came" and that will slowly be revealed also. I don't want to individually add a new char via the code.
Your answer
![](https://koobas.hobune.stream/wayback/20220613154943im_/https://answers.unity.com/themes/thub/images/avi.jpg)