Skip to main content
Participating Frequently
June 12, 2023
Question

Follow path horizontally centered

  • June 12, 2023
  • 4 replies
  • 1674 views

Hello,

Is there a way to horizontally center the circle in the composition while following the path?

Right now the speed of the circle is not aligned with the scroll because the path is not linear (video attached)

Thanks in advance

-Josh

This topic has been closed for replies.

4 replies

Inspiring
June 13, 2023

Just an idea: does the circle and line align when you use linear keyframes? You could then precomp the animation and apply time remap with the desired easing.

JoshStAuthor
Participating Frequently
June 13, 2023

Hey Christian, sadly no, it still doesn't line up 😞

Mathias Moehl
Community Expert
Community Expert
June 13, 2023

Oh, yes, that's a tricky problem. If you separate dimensions, it will most likely change the motion path (probably already in the moment you separate, but if not then definitely when you start changing the easing of x or y independently).

If the scrolling animation is linear, your goal should be to change the easing such that the value graph for X becomes a straight line, however, it will probably be very tricky to eyeball that. You would need to link the speed of the circle to the slope of the curve, somehow. The steeper it is, the faster it needs to move.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
JoshStAuthor
Participating Frequently
June 13, 2023

thank you for your answer, do you know a way to link the speed to the slope of the curve?

Mathias Moehl
Community Expert
Community Expert
June 13, 2023

No, unfortunately not.

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
Dan Ebberts
Community Expert
Community Expert
June 13, 2023

How are you tracking the path?

JoshStAuthor
Participating Frequently
June 13, 2023

I copied the path from the line and pasted it in the position of the circle. 

Dan Ebberts
Community Expert
Community Expert
June 13, 2023

Try this position expression developed by Filip Vandueren:

t1= key(1).time;
t2= key(numKeys).time;

x1=key(1).value[0];
x2=key(numKeys).value[0];

linear_x=linear(time, t1, t2, x1, x2);

precision = 3; // make this higher (16) if you need Motion blur
fd = thisComp.frameDuration/precision;

y=key(1).value[1];

for (t=t1; !(t>t2); t+=fd) {
	v=valueAtTime(t);
	if (v[0]>=linear_x) {
		y=v[1]; 
		break;
	}
}

[linear_x,y];
Participating Frequently
June 13, 2023

Looks like you just need to apply the same easing values to your circle as you have on the scroll. And also same keyframe start/end time (which I think you already have)

 

Note: you could also play "seperate dimensions" on your circle position, but matching easing values seems easier.

JoshStAuthor
Participating Frequently
June 13, 2023

Hey thx for your answer.

The problem I have with the easing that the altitude of the path makes it way different than the linear scrolling animation because the circle has to move futher. I can't think of a way to match the easing like that. If you know a solution for that I'd love to hear it.