[UMG] How to animate text like it's being typed out?

Hi, I’m currently using UMG to create my subtitle/NPC dialogue system.

For now, my block of text simply fades in and out, but I was wondering if there’s any way to animate my text widget so that the contents look like they’re getting typed out?
There is no need for the blinking underscore behind it, but i just want it to roll out naturally instead of showing a giant block of text right away.

Any help, demos or guidance is appreciated. Thanks!

Here is the basics:
Take your Completed string, pass it into a For Loop(last index determined by passing the completed string into LEN, first index is just 0)
The loop should contain: LEFT(your completed string feeds into this, also the “Index” from the for loop feeds into it) and then a pause of 0.1 seconds or similar.
effectively each time around the loop it adds one more letter to the length of the output string.
This should be responsible for updating the UMG widget variable that feeds on screen display.
in the completed part of the for loop, i’d add a delay of a second or so, and then remove the UMG widget.

Thanks! that makes a lot of sense and helped me greatly.
However, I’ve run into a problem as my string still prints as one sentence instantly. I put a print string at the end of every loop for debug, and realized that it was only called once with the whole string printed.

http://puu.sh/kMPs4/1179e221e1.jpg

hmmm. maybe i’m being stupid with the for loop, it seemed the most logical. after a bit of checking the for loop runs through all iterations in the space of one tick. which explains what you are seeing.

this isn’t a problem, it just makes things a little more interesting.
similar approach, just varied slightly.
it would need to be done using event tick and a series of variables for doing making your own for loop.
like set textindex=0, (do the len, left stuff here) then set textindex=1, delay 0.1 (event tick will obey this delay) and repeat - you will need a variable to store the string length and compare textindex to it.

if anyone else has an idea, let me know :stuck_out_tongue:

Yep, turns out a manual loop does the trick. Thanks! :slight_smile:

If anyone has done this recently. Can you please post up some screenshots of how. I need this too but this post didnt help me much because im new to this stuff :stuck_out_tongue: I need your help, thanks

This is a simple method I use for my typed out text animation: