-
retaining value
i was wondering how to retain a certain value for use later.. for example, i have 2 layers and layer2’s position is simply following layer1’s position. layer1 is just steady moving from left to right. layer2’s opacity is keyframed to go from 100 down to 25. when it gets to 25, i want it to stop where it is, so basically at the position of layer1 at the time that layer2 reaches opacity of 25.
so i guess something like this:
if (thisLayer.opacity.valueAtTime(time) == 25){
[myPos[0], myPos[1]]
} else {
myPos = thisComp.layer(“layer1”).transform.position
position = myPos
}of course the issue is when opacity is 25, AE doesnt know what myPos is yet. can i declare it somewhere? it seems like the script is read and ran every frame, so putting something at the top is useless since it just gets cleared every frame…
thanks.
m