[HOWTO] How To: Adjust Typewriter Speed
Posted: Thu Apr 16, 2020 11:19 am
This post explains how to set the typewriter speed.
First, make sure you can edit your dialogue UI. You can edit the dialogue UI prefab directly, but you may find it easier to add an instance of the dialogue UI to your scene. Drag it into the Dialogue Manager's Dialogue UI field. If the Dialogue System asks if you want to add an instance, click the Add Instance button:
OR:
If the same dialogue UI prefab is already assigned to the Dialogue UI field, it will not ask this. Instead, manually add the dialogue UI to the Dialogue Manager's Canvas, and manually assign it to the Dialogue UI field:
Next, expand the dialogue UI until you can see the Subtitle Text GameObject in the subtitle panel that you want to change. Set the typewriter effect's Characters Per Second to a higher number to make it type faster. Set it to a lower number to make it type slower:
Note that this value is different from the Dialogue Manager's Subtitle Settings > Subtitle Chars Per Second:
Subtitle Chars Per Second and Min Subtitle Seconds specify how long the subtitle will stay onscreen. Subtitle Chars Per Second should never be higher than the typewriter's Characters Per Seconds. Otherwise the subtitle will disappear before the typewriter has finished. For more information about Subtitle Chars Per Second, see the Cutscene Sequences Tutorials.
Additional Note:
Normally the continue button jumps to the end of the text if the typewriter is still typing. If the typewriter is done typing, it continues to the next stage in the conversation. If you want the continue button to speed up the typewriter instead of jumping to the end of the text, see this post.
Changing Speed:
If you want to instantly display parts of text, you can use RPG Maker-style control codes in your text.
If you need to speed up or slow down text while typing, this example combines custom speedup scripts with the multiple subtitle panels in the WRPG template discussed in this thread:
WRPGPanelsWithTypewriterSpeedup_2022-11-02.unitypackage
Summary of the changes:
First, make sure you can edit your dialogue UI. You can edit the dialogue UI prefab directly, but you may find it easier to add an instance of the dialogue UI to your scene. Drag it into the Dialogue Manager's Dialogue UI field. If the Dialogue System asks if you want to add an instance, click the Add Instance button:
OR:
If the same dialogue UI prefab is already assigned to the Dialogue UI field, it will not ask this. Instead, manually add the dialogue UI to the Dialogue Manager's Canvas, and manually assign it to the Dialogue UI field:
Next, expand the dialogue UI until you can see the Subtitle Text GameObject in the subtitle panel that you want to change. Set the typewriter effect's Characters Per Second to a higher number to make it type faster. Set it to a lower number to make it type slower:
Note that this value is different from the Dialogue Manager's Subtitle Settings > Subtitle Chars Per Second:
Subtitle Chars Per Second and Min Subtitle Seconds specify how long the subtitle will stay onscreen. Subtitle Chars Per Second should never be higher than the typewriter's Characters Per Seconds. Otherwise the subtitle will disappear before the typewriter has finished. For more information about Subtitle Chars Per Second, see the Cutscene Sequences Tutorials.
Additional Note:
Normally the continue button jumps to the end of the text if the typewriter is still typing. If the typewriter is done typing, it continues to the next stage in the conversation. If you want the continue button to speed up the typewriter instead of jumping to the end of the text, see this post.
Changing Speed:
If you want to instantly display parts of text, you can use RPG Maker-style control codes in your text.
If you need to speed up or slow down text while typing, this example combines custom speedup scripts with the multiple subtitle panels in the WRPG template discussed in this thread:
WRPGPanelsWithTypewriterSpeedup_2022-11-02.unitypackage
Summary of the changes:
- Put a separate continue button in each subtitle panel.
- Add one StandardUIContinueButtonSpeedUp script to each continue button. Assign the panel's typewriter effect.
- Add multiple ResetTypewriterSpeed scripts to the dialogue UI GameObject, one for each subtitle panel. Assign the panel's typewriter effect.