-
Offsetting position coordinates
Hi there,
I’m a newbie to expressions and have been working on this one all day. I’ve been reading some the posts and tutorials so you might notice some replicated code (thanks to those who have put up code I’ve copied!) But now my brain has turned to mush, so I need some help…What I am simply trying to do is to take only one part of a position coordinate (say the x value) from one layer and have that duplicated in the layer below. With the code I am using it tells me the expression can’t be more than one value.
In more detail i am trying to get duplicated layers to follow behind the the main layer by offsetting the time at which it duplicates the position coordinates. Thats been all good:
i = index – 1;
thisComp.layer(i).transform.position.valueAtTime(time-.5);But now I want to offset the x, y, z values independently. So that the x value is say .5 sec behind, the y value is 1 sec and z value is 1.5 behind. I’ve tried using the above code for each value like this:
i = index – 1;
x = thisComp.layer(i).transform.position.valueAtTime(time-.5);
y = thisComp.layer(i).transform.position.valueAtTime(time-1);
z= thisComp.layer(i).transform.position.valueAtTime(time-1.5);
[x,y,z]This is where it tells me it can’t expand to more than one value. I can see that it’s trying to copy in the whole coordinate for each value but I can’t work out how to alter the code to insert only the corresponding value.
Hope that makes some sense – I’m too wrapped up in it to make top or tail of it for the moment.
Thanks Rob