What's the best approach for running my typewriter effect blueprint multiple times at the same time?

Hello!
I made a blueprint for a typewriter effect that can be used by my widgets (so text appear character by character).

Basically it has a function that triggers an event which takes the text and a reference to the widget text box you want to print in, and it takes the text, converts to string, converts into an array of characters, then loops and adds them to the text box.
Plus it plays a sound whenever it does that.

Works great.

The problem is I have multiple fields that need to use it simultaneously, and when one is running, the other one cannot.
I guess because it’s the same reference? It seems to be only one instance.

I need to be able to work them separately, regardless of each other.

I wrote the blueprint as an actor blueprint (I have to place it in the game world even though it’s pure code…), and then I use ‘get actor by class’ from the widget to get it and use the function.

How do I make each usage an instance on its own?

What would be the better approach?

Thanks in advance for your advice!

Spawn a new actor every time you call the print function (and don’t forget to delete it when it’s done its job). This way you don’t have to create anything on the level initially.

It may also make sense to replace the actor class with an object if it will have all the functionality you need available.

1 Like

Yep, that seems to have done it. Thanks!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.