Forum Discussion
CraigJohnson-9d
5 days agoCommunity Member
Animated on Screen Text (Chat GPT Style)
Hey everyone! I'm looking for a way to solve a customer request of animating the text to speech to show on screen like you'd see as Chat GPT is writing text on screen word by word. I can't think of a...
var player = GetPlayer();
var newIncomingText = player.GetVar("newText");
var newOutgoingText = "";
var myArray = newIncomingText.split("");
var arrayLength = myArray.length;
function typeText() {
newOutgoingText = newOutgoingText + myArray[0];
myArray.shift();
player.SetVar("displayText",newOutgoingText);
arrayLength = myArray.length;
if (arrayLength == 0) {
clearInterval(myInterval);
}
}
// A letter is typed every 100ms, adjust the typing speed by changing the 100 number below
var myInterval = setInterval(typeText, 100);
There is javascript on here to achieve that, this is some old code I used to do it one character at a time.
CraigJohnson-9d
5 days agoCommunity Member
Thank you! I haven't personally used javascript, how would I insert this into Storyline to accomplish the effect?