How to sync panner animated material with Blueprint animation?

Hello everyone,

I have a conveyor belt that moves for 8 sec., then stops for 5 seconds. and move again for 8 sec, sequence repeating. But my material for the conveyor belt moves constantly with no stops, it’s driven by a simple Panner function.

I’m trying to synchronize BP movement with stops and material animation with the Panner function.

Hello there!

Please check how Dynamic Materials are used.

You have nothing after Create Dynamic Material Instance node. You should store and assign the resulting dynamic material and later on use that variable to modify its parameters.

Something like this:

This should allow you ti change the Y Speed runtime. Now it’s just a matter of calculating the texture size of your conveyor in real world units and calling Change Material Speed whenever the conveyor speed changes.

1 Like

Thank you for replying,

I’ve added my question about variables in the screenshot:

Conveyor contains two volumes moving in opposite direction, upper and bottom.

This is the size of the Volume box of the conveyor unit:

Upper: (X=155.000000,Y=100.000000,Z=10.000000)

Bottom: (X=122.000000,Y=100.000000,Z=10.000000)

This is what I’ve got at the moment:

The white line is the execution line - connecting execution pins. In essence all nodes are called along the white line one after the other.

Now when a node with a white line is executed all nodes connected to its input pins are called - getters, operators, pure functions, and all output values (if any) are calculated and stored.

The green getter (and green lines) are of type float, yes.

Yellow are vectors, light purple are rotators etc… For more info on variables: https://www.youtube.com/watch?v=wWEIDf2u8IE

For some reason your dynamic material variable is of type rotator and the texture size is a vector.

Try to get a better understanding of how blueprints are created and how variables are used. I would recommend the official documentation: Blueprints Visual Scripting in Unreal Engine | Unreal Engine 5.7 Documentation | Epic Developer Community

But I think any kind of basic blueprint tutorial will work.

1 Like

Thank you,

This is what I’ve got, still no luck:

The material is not moving.

I think in this case I need to sync physical conveyor movement values with dynamic material, which is using those values instead of new float Var of Texture size

please correct me if I’m wrong

No, not instead.

The reason for the TextureSize variable is because Speed Y is in texture coordinates meaning that if you set Speed Y = 1.0 you will move the whole texture for one second. If you want to move the texture let’s say 30 units in one second you’ll have to know how much is 30 units in texture coordinates - in other words - how big is the texture. If the texture is stretched on a 100x100 cube and you want to move it 30 units/s your Speed Y should be 30/100 = 0.3

That thing with the time… I have no Idea what are you doing there. I thought you just have to set the new material speed when you start and stop.

Unfortunately this doesn’t produce perfetct result as of a jump each time you start and stop the conveyor. This is due to the fact we are using Time in the material and time continues to flow even when we set the speed at 0.

The only way to fix that is to track the actual offset in the BP and add that offset to the material each time you start and stop the conveyor.

1 Like

Okay, I see that makes sense with the Texture size, then.

I marked those values, so my conveyor moves and stops automatically and constantly. Move time: 8 sec, Wait time: 5 sec.

What I need to do is to make a Material animation to move and wait conveyor belt texture with exactly the same intervals as the actual blueprint moves an object along the conveyor. Or in other words, I need to make a Panner effect to stop the moving texture along the Y axis for 5 seconds. and keep moving for the next 8 seconds after that, repeating the cycle.

Maybe it’s something to deal with Time rather than speed:

I’ve recodred what it looks like:

Try to reproduce my setup. It will start and stop exactly as you want.

Unfortunately my math isn’t entirely right…

Calculation of the offset in the tick is not actually needed. We know what the offset will be as soon as we start the convener: it will end up Speed*OnTime

This simplifies the things a bit but doesn’t entirely solve the problem of texture jumping. Once you start the conveyor is starts from Speed*GameTime.

So the to get the correct position you’ll need Speed * GameTime - Offset = Speed * OnTimewhich makes Offset = Speed * OffTime

It’s getting late and I really need to run but please try what I’ve posted and I’ll try to update it tomorrow.