-
set initial x, y, and z with expression – subsequent frames hold frame 1 values
It seems afx re-runs expressions every frame without remembering previous frame’s variables values. How do you work around this?
I would like to re-use the initial variables (x, y and z) set at frame 1, so that the position is not changing in subsequent frames. Code below.
[code]
if(time == 0){
x = Math.floor(random(thisComp.width));
y = Math.floor(random(thisComp.height));
z = Math.floor(random(-300, 300));
[x,y,z];
} else{
// of course this produces errors
[x,y,z];
}
[/code]I’ve seen similar problems in other posts here, but can’t seem to work those into this scenario. If so, could you please send link?
Thanks