Text Animator for Unity
More ToolsTutorialsDiscord✨ Get Text Animator ✨
2.X 🇬🇧
2.X 🇬🇧
  • ❤️Welcome
    • Text Animator for Unity
    • Features
    • Games Showcase
    • Quick Start
  • ✨effects
    • Add effects to your texts
      • Modifiers
      • Styles
      • Databases
    • Preview and Edit effects
      • Dynamic Scaling
      • Time Scale
    • Built-in effects list
    • Create your own effects
      • Create effects in the Inspector
        • Curve Effects
        • Composite Effects
      • Writing Custom Effects (C#)
  • ✏️typewriter
    • Show and hide letters dynamically
    • Play sounds when a letter is shown
    • Trigger Events when typing
    • Wait Actions when typing
  • 🤝Integrations
    • Integrated Plugins & Dialogues Systems
      • Dialogue System for Unity
      • Yarn Spinner
      • Ink
      • Game Creator 2
      • Unity Localization Package
      • Playmaker
      • Unity Visual Scripting
      • Naninovel
    • How to manually integrate Text Animator
  • Extra Customization via C#
    • Writing Custom Typewriters (C#)
    • Writing Custom Actions (C#)
  • Other
    • Best Practices
    • Requirements & Limitations
    • Frequently Asked Questions
    • Support
    • Changelog
      • 2.X
      • Upgrading from 1.X to 2.X
      • 1.X
    • Scripting API
Powered by GitBook
On this page
  • Showing Text
  • A) Via Code (Recommended)
  • B) Via the “Easy Integration”
  • Controlling Letters
  • Start and Stop Typing
  • Skip the Entire Text
  • Skip Specific Parts of the Text
  • Hiding Text
  • Options
  • Callbacks (Unity Events)
  1. typewriter

Show and hide letters dynamically

PreviousWriting Custom Effects (C#)NextPlay sounds when a letter is shown

Last updated 5 months ago

You can use Typewriters to show and hide letters dynamically, choosing different pauses for any kind of characters (punctuation, letters, […]), trigger events and more.

A typewriter uses its linked Text Animator Time Scale to progress time, you can read more here: Time Scale


Showing Text

There are different types of typewriters, for example “By Character” which shows one letter after the other, or “By Word” which progresses text word after word.

After choosing which Typewriter to use (which means: after adding the component on the same GameObject that has a "TextAnimator" one), you can start it in two main ways:

A) Via Code (Recommended)

Replacing “tmproText.text = textValue;” with typewriter.ShowText(textValue); in your code ().

Please don't miss this step if you're setting the text via code! If you're having issues, take a look at the Best Practices

B) Via the “Easy Integration”

Enabling the “Typewriter Starts Automatically” option in the TextAnimator component (p.s. this was previously called “Easy Integration”). This will let the plugin automatically check for text changes from your TextMeshPro’s component and start the typewriter based on it.


Controlling Letters

Start and Stop Typing

Inside the component’s Inspector you’ll find some options to control how the typewriter start should be triggered:

  • Start Typewriter Mode: tells the typewriter when to start showing letters.

Value
Explanation

From Script Only

OnEnable

The typewriter starts every time the gameObject is set active

OnShowText

Automatically From All Events

All of the above

  • Reset Typing Speed At Startup: true if you want the typewriter’s speed to reset back to 1 every time a new text is show, otherwise it will save the last one used.

You can also test this in Play Mode from the Inspector (the buttons are only greyed out in Edit Mode).

Skip the Entire Text

You can also find a few options to control how it behaves:

  • Hide Appearances On Skip: true if you want to prevent appearance effects from playing whenever the typewriter skips (meaning that the text will be shown instantly).

  • Trigger Events On Skip: true if you want to trigger all remaining events once the typewriter skips (be careful with that if you’re running some game logic with them, as everything will be run at once). Read more about events here: Trigger Events when typing

Skip Specific Parts of the Text

You can use the "<notype>" tag to skip the typewriter under specific sections of the text. For example "Hello <notype>I am shown instantly</notype> and now I'm typing normally again."

You can also change this tag in the global settings, in case you prefer to set a different one.

Hiding Text

You can also test this during runtime through the buttons in the Inspector.


Options

Typewriters might share the same settings and also have specific ones, so be sure to hover the mouse cursor above its fields in the Inspector to show the tooltips for each one.

Here is a quick overview of the most important/common ones:

Callbacks (Unity Events)

You can use Unity Events that will be triggered based on the typewriter activity (example: when it just ended showing text).

Event
Explanation

OnTextShowed

Event called after the entire text has been shown (if you’ve set “Use Typewriter” to true, it will wait until all letters are shown)

OnTextDisappeared

Called as soon as the script starts hiding the last letter

The following below only work if the “use typewriter” is set to true:

Event
Explanation

OnTypewriterStart

Called right before the typewriter starts showing its first letter. It doesn’t work if the typewriter is off, since it would coincide with the “OnTextShowed” event (in this case you can use that one instead)

OnCharacterVisible(Char)

Called each time a character became visible

OnMessage(EventMarker)

You can hover the mouse above the typewriter options (e.g. delays) to show some tooltips and extra information!

The typerwiter can only be started by invoking

The typewriter starts as soon as a new text is set ()

You can pause the typewriter at any time by invoking , and you can start/resume it by invoking .

To Skip the entire typewriter, you can invoke the method.

You can hide letters dynamically via script, by invoking , and you can also stop it at any time by invoking .

You can create your own typewriter (read how to create a custom typewriter via C#) or you can use the built-in one.

Invoked every time the typewriter meets a message/event in text. Read more about events

✏️
typewriter.StopShowingText()
typewriter.StartShowingText()
typewriter.SkipTypewriter()
typewriter.StartDisappearingText()
typewriter.StopDisappearingText()
here
TextAnimatorPlayer.StartShowingText()
here
as explained in the “Showing Text” section
Scripting API