I'm trying to make clouds move out of frame and than appear again from the other side.
First time if statement works as expected. tBound becomes 40s and it offsets cloud. But when time gets bigger than 40 nothing happens. Neither offset variable gets bigger nor tBound. If statement doesn't work anymore. What's the problem here?
var vel = 100;
var pInit = position.valueAtTime(0); // initial position of a cloud
var tInit = (thisComp.width-pInit)/vel; // time it takes to cross the right border starting from init position
var tFull = (thisComp.width+width)/vel; // time it takes to cross the frame starting behind the left border
var offset = 0;
tBound = tInit;
Couldn't you use just the "Motion Tile" animation preset and animate the tile center's x-axis? You could easily put an expression on that property and change the speed.
Just an idea for a simple solution… 😉
x = time*100;
y = effect("Motion Tile")("Tile Center");