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.
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.
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.
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.
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
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.
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:
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.