Skip to main content
Participant
March 5, 2022
Answered

Puppet pin to follow another with a delay

  • March 5, 2022
  • 1 reply
  • 450 views

Hi all.

My problem is probably really easy to solve, but I can't figure it out (I'm just starting with AE expressions).

I have a circle with two puppet pin points, ppp1 at the bottom and ppp2 at the top. 

What I want is ppp2 to follow ppp1 with a delay, but only in the x axis. 

I found this:
delayFrames = 4;

p = effect("Puppet").arap.mesh("Mesh 1").deform("Puppet Pin 1").position;

idx = parseInt(thisProperty.propertyGroup(1).name.split(" ")[2],10)-1;

delay = idx*framesToTime(delayFrames);

p.valueAtTime(time-delay)

 

And it works but with the x and y, and I want it only to follow the x, maintaining the y the same.
How can I do this?

 

Thanks in advance!

This topic has been closed for replies.
Correct answer Dan Ebberts

Try changing the last line to this:

[p.valueAtTime(time-delay)[0],value[1]]

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
March 5, 2022

Try changing the last line to this:

[p.valueAtTime(time-delay)[0],value[1]]
gonpleonAuthor
Participant
March 8, 2022

It works! thanks a lot.