UMG: Do Once not working, stuff not in scope, can't figure out what to do :(


I don’t understand, all I’m trying to do is have a Text widget change it’s color randomly and smoothly. Like, 10 seconds from green to blue, then from blue to red, then from red to whatever the next random color is. But I can’t even fire the thing once and I’m getting per frame interps instead of smooth ones. Nothing local shows up as in scope, so I can’t figure out what outputs I’m getting. Since there is no timeline in UMG, I tried a makeshift timer that incremented a float by the frame delta time, compared it to a desired firing rate with an if (like 1 second or something) and then fired off and reset the timer back to 0. But that didn’t work as well, and due to the not in scope thing I really don’t know what I’m doing wrong.

I’m kind of lost at what to do here.

Edit: I used the DoOnce so that I can at least see if the interpolation works right.

Edit2: I made a while loop timer, but that doesn’t work either. It seems that these flow control methods are being called every tick, and then destroyed by the garbage collection and that’s why they don’t execute properly.

I made this quickly.


Oh, I totally forgot about a bool. Thanks. Though it does seem that Binding functions to Widgets are glorified getters. There’s not even a tick rate setting :frowning: Thanks man.

Just one thing I haven’t figured out. Interp Speed represents seconds right?

Edit:Nvm, this doesn’t seem to work. Even after tweaking it a couple of times, the bool is always reset every tick. Looks like I’ll have to sort it out outside the Bind function.

The Speed isnt for the seconds.
Take a lower number 1 or 0.1 and it will take some time.

Edit: Ok too slow, take 5 and if you want print the color after setting current color to see the progress.

Aight I managed to get it to work. It didnt work before due to the fact that I made color and bool variables local and they got garbaged. Thanks again man, I’ll be looking for another solution at least for performance sake.