Change the direction of a panner seamlessly

Hi,

i have a texture that pans and i can change the speed in x and y direction via a material parameter collection.
Everytime i change the speed the texture resets to an old position and starts panning from this position.
So instead of having a texture that seamlessly increases and decreases in Speed, i have a jumping texture with multiple panning Speeds.
How can i keep the current texture position and just change the panning Speed ?

Check out FInterp To node. You can set the current and wanted speed values and give it an interp speed to get a smooth transition.

Thanks, but it doesn’t help. I made a Video of the panning texture - YouTube
I set the panning speed to 0.1 on X and Y and then back to 0.0 and as you can see, the texture jumps back to ist original UV Coordinates and not the shifted ones.
So i want the texture to pan, stop, and stay at this Position.

Hi,

so i had the same problem and after a little bit of thinking i found the main problem here… we need delta t to calculate the offset but only have t and no possibility to save a value from last iteration

so here my solution:
calculate the offset in blueprint, where we have delta t and put it as parameter into the material
(rendering happens every tick anyway so there shouldn’t be a performance impact)

i update the parameter of the dynamic material every tick in my blueprint

for my project i only needed the x direction and the uv should flip if speed is negative. That’s why i multiply with the direction which should only be 1 or -1.

if you want to use both x and y you need a second offset value and you have to calculate it separately…

also if your uv tiling is not 0…1 but something else you have to adjust the modulo operation in the update function i posted in the comment

the math behind this is basic physics… (x_i | i:= timestep)

x_1 = Δt * v + x_0

x_2 = Δt * v + x_1

x_n = Δt * v + x_n-1

you could even use acceleration or inertia as long as you have a delta t… :wink:

and sorry for the late answer to your problem, hope it still helps

and the update function:

and don’t forget that in this example the speed is uv/sec… so if you stretch your material the speed will vary…

1 Like

There is a simpler way, and It is actually manually constructing the panner node so that you have manual control as seen below:

Hope this helps

Hi,
I had this same question and the answer from Dave4723 solved the problem for me. Thanks Dave.
My setup was pretty different from yours but the delta time multiplier was the key.

Hope you can help me, I wasn’t able to figure out how to do this for just panning in the y-direction, it keeps panning in the x for me, could you please tell me how to fix that? I would be eternally grateful!

Or you can just plug that append into the Speed pin of a Panner node and it does the same thing.

350514-pannerparameter.jpg

1 Like