- Home /
Controlling text speed
I want to know if it's possible to have text from a GUI.Label print on the screen at a speed I can adjust from a variable. For example, I want it to look like when you're talking to a NPC in Pokemon. If anyone can point me to a tutorial or explain this to me in JS, I'd appreciate it.
Not sure what you want, but you might Google "Unity3d typewriter effect."
Answer by keburanuil · Apr 14, 2014 at 05:47 PM
I think you mean autotyper. Here is a script from http://wiki.unity3d.com/index.php?title=AutoType
var letterPause = 0.2;
private var word;
function Start () {
word = guiText.text;
guiText.text = "";
TypeText ();
}
function TypeText () {
for (var letter in word.ToCharArray()) {
guiText.text += letter;
yield WaitForSeconds (letterPause);
}
}
You can adjust the speed with letterPause variable. It waits that amount of time and then writes next letter.
Your answer
![](https://koobas.hobune.stream/wayback/20220613142250im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
how i know my object speed ? 1 Answer
How do I display the contents of a class in a Label 0 Answers
Variable won't appear on UI text (JS) 0 Answers