Pause/show text based on time

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Pause/show text based on time

Post by chud575 »

Howdy,

Is it possible to wait x seconds for say, the 2nd line of dialogue to appear??

Like what I. wanted a phrase that said "OH. MY. GOD.", but I want it to display 1 word each second?
User avatar
Tony Li
Posts: 21061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pause/show text based on time

Post by Tony Li »

Hi,

Use RPGMaker-style codes. They're supported with Unity UI Dialogue UI. If you're using TextMesh Pro, they're now also supported in the updated TMP support package on the Dialogue System Extras page. The "\." code tells the typewriter effect to wait for one second. (You can change the duration by inspecting the subtitle line's typewriter effect.) You could set your Dialogue Text to:
  • Dialogue Text: "OH.\. MY.\. GOD."
chud575
Posts: 50
Joined: Thu May 11, 2017 10:57 am

Re: Pause/show text based on time

Post by chud575 »

interesting, if I pause for longer than it would normally take, it just skips.

So if a line of text takes 1s to complete, and you add two '\.' (1s) delays, instead of continuing to type at the end of the 2nd delay, it just. skips to the end.

Is that normal?
User avatar
Tony Li
Posts: 21061
Joined: Thu Jul 18, 2013 1:27 pm

Re: Pause/show text based on time

Post by Tony Li »

Similar to your other post (about CinemachinePriority), the Sequence needs to last long enough for the typewriter to finish.

Let's say your default sequence is Delay({{end}}), and this is long enough for the typewriter to finish. If you add two 1-second delays, you'll need to extend this out. Sequences don't do math -- so Delay({{end}} + 2) isn't valid -- but you can use the "@" syntax to tell a command to start at a certain time, such as:

Code: Select all

Delay({{end}})@2
This will essentially add 2 seconds to the delay, allowing time for the typewriter to finish.
Post Reply