Skip to main content
Participant
April 23, 2025
Question

how to get googly eyes linked to object movement

  • April 23, 2025
  • 1 reply
  • 455 views

Now i have my muppet head moving up and down I'd like to get his googly eyes reacting to the head motion and settling when the motion stops. The pupils inside the eye 'dome' should randomly bounce around while the character is talking and then come to a stop at the bottom when the character stops talking. it should look like gravity is in play. I dont know if this should be linked to the head movement or the dialogue. I've found expresssions for sine waves, pendulums and wiggle but they dont quite achieve the effect. Any ideas much appreciated!

1 reply

ShiveringCactus
Community Expert
Community Expert
April 23, 2025

Here's what I got with a little bit of playing:

 

I created a white circle for the eye, set to 100 pixels radius.  Then I made a smaller black pupil and made it a child of the white circle and also used it as the track matte.  Then I adapted Dan Ebberts' Elastic Expression, so that I could limit the range of movement:
https://www.motionscript.com/design-guide/elastic.html

 

restLength = 20;
damp = .99;
leader = thisComp.layer("Eye");

fDur = thisComp.frameDuration;
currFrame = Math.round(time / fDur);

p2 = position.valueAtTime(0);
v2 = 0;
for (f = 0; f <= currFrame; f++){
  t  = f*fDur;
  p1 = leader.transform.position.valueAtTime(t);
  delta = p2 - p1;
  nDelta = normalize(delta);
  a = 2 * nDelta * (length(delta) - restLength) * fDur;
  v2 = (v2 - a) * damp;
  p2 += v2;
}
p2
x = linear(p2[0],0,thisComp.width,-50,50);
y = linear(p2[1],0,thisComp.height,-50,50);
[x,y]

 

shaun98A1Author
Participant
April 24, 2025

Definitely Googly! I tried it out but was hoping the pupils would settle when not moving. They float and wobble but dont seem to react to the head movement. I'll keep trying. Thanks again!

ShiveringCactus
Community Expert
Community Expert
April 24, 2025

Try adjusting the damp and restLength variables. 

 

Also if you repoint leader so that it is looking at the head's position, it should react to the head movement.