Slight Pause between characters

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Slight Pause between characters

Post by PayasoPrince »

Hello,

I'm trying to figure out how I can have the typewriter pause for a moment between characters during dialogue.

For example:
"Is that a..." (Pause for 2 seconds) " a GHOST??"

Is there a simple way to accomplish this? :?:
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Slight Pause between characters

Post by Tony Li »

Hi,

Use RPG Maker-style codes in your dialogue text:

"Is that a..." \.\. " a GHOST??"
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Re: Slight Pause between characters

Post by PayasoPrince »

Very simple and easy to work with! :mrgreen:

I am curious, I don't want the player to be able to fastforward or (Stop()) the typewriter effect during a pause. Is it possible to temporarily disable the fastforward button and then reenable it once the pause is over? :idea:
User avatar
Tony Li
Posts: 22152
Joined: Thu Jul 18, 2013 1:27 pm

Re: Slight Pause between characters

Post by Tony Li »

If you're using UI Text, you can make a subclass of UnityUITypewriterEffect and override PauseForDuration:

Code: Select all

protected override IEnumerator PauseForDuration(float duration)
{
    // Disable your fast forward button here.
    yield return base.PauseForDuration(duration);
    // Re-enable it here.
}
If you're using TextMeshProTypewriterEffect, you'll need to either wait for version 2.2.25 to do the same thing as above, or make a subclass and override the entire Play method.
User avatar
PayasoPrince
Posts: 104
Joined: Thu Jan 27, 2022 6:47 pm

Re: Slight Pause between characters

Post by PayasoPrince »

Ah, alright. I'm using TextMeshPro. So, I guess I'll wait for version 2.2.25.

Glad to know that I can use it in the future!
Post Reply