FInterp to smoothly transform between random

Hey guys
I’m not really sure I understand the use of FInterp To node.

In this example I’m trying to smoothly move a widget image to a random position, however it’s not working as expected and the image jumps between the random position. I’m quite sure I’m missing something.
FYI at this stage I set the ‘Old’ variable to be a constant 0, while the ‘PeriodicPing’ event is just a 2sec looping timer that triggers the random seed.

I uploaded two videos, one with InterpSpeed = .5, the other =150


You’re not defining a time frame for the transition. Without one it happens in a single frame. Thus the point of Timelines.

Also Tick fires every frame.

Yeah I’m aware of it, however timelines are not available inside Widget BPs hence why I’m not using them.
I could always create them separately, but being a simple “menu” level I was trying to maintain everything inside the widget.

Would you recommend moving the logic to a separate BP?

You could run it in the controller and call an event in the widget to update the element.

I think the issue is the “Old” variable. Notice the Finterp node asks for the “current” position, not the starting position. This is assuming you’re setting the old variable periodically as well.

I’m pretty sure if you put the current position of the block in, you’ll likely see the results you’re looking for.

I really don’t like this sort of hacky approach and I think it’s bad advice for something like this. An Finterp is entirely fine if the goal is to smoothly move a widget element from one point to another. Why complicate it by rerouting code all over the place?

If you really wanted more fine tune control using a timeline, create a new actor with a timeline and some expose on spawn variables. Create the actor and input the variables you need to control the movement via the timeline (Like the actor or widget components you want to move, trying to be as generic as possible here, the play rate if you need, and the start/end locations, etc.). When the movement is finished, destroy the actor. This is much cleaner than making a new timeline on your controller for every moving part, and you can spawn multiples of them at a time, so you don’t have to worry about accidentally overlapping animations.

The script is almost fine bar one thing: you never update Old - Current value. Instead of Old, pipe in the Block’s transform translation X. Interp needs an up-to-date sample of what happened last.


And if you must have something like a Timeline in a widget, you can use widget animation and treat its progress as alpha. Repeater events produce an update every frame. But it does not seem necessary here if you’re happy with the widget ticking.