Copy link to clipboard
Copied
Hi,
I want to animate somthing. but dnt know how can I do that. I want to take value for position a to b from a trim path animation. but also I want the postion to be above the trim path. I want to make it look like it's floating. wiggle I applied. but I dnt understand how to write the expression. please help.
in blue box green bar animation, I applied the expression. but the box is not above the bar, like the second sceneario. How can I make the box take its position value from trim path and also remain to be above. thank you.
I think I try something like this:
yOffset = -100;
L = thisComp.layer("Line");
p = L.content("Shape 1").content("Path 1").path;
w = wiggle(3,5) - value;
L.toComp(p.pointOnPath(L.content("Shape 1").content("Trim Paths 1").end/100)) + [0,yOffset] + w
You could certainly replacye the Trim Paths End point with a slider if you want to.
Copy link to clipboard
Copied
I think I try something like this:
yOffset = -100;
L = thisComp.layer("Line");
p = L.content("Shape 1").content("Path 1").path;
w = wiggle(3,5) - value;
L.toComp(p.pointOnPath(L.content("Shape 1").content("Trim Paths 1").end/100)) + [0,yOffset] + w
You could certainly replacye the Trim Paths End point with a slider if you want to.
Copy link to clipboard
Copied
Hi Dan, Thank you so much. I did it!! I screamed so loud outta happiness that I think International Space Station's astronuts cud hear me. Thank you. this is so cute.
Copy link to clipboard
Copied
Hi Dan,
am experimenting. why the expression is not working now?
Copy link to clipboard
Copied
I'm not sure what you're after exactly, but maybe this:
offset = -100;
L = thisComp.layer("Line");
p = L.content("Shape 1").content("Path 1").path;
w = wiggle(3,5) - value;
newP = L.toComp(p.pointOnPath(L.content("Shape 1").content("Trim Paths 1").end/100));
v = p.normalOnPath(L.content("Shape 1").content("Trim Paths 1").end/100);
newP + v*offset + w
You might have to change the sign for offset, depending on how you drew the path.
Copy link to clipboard
Copied
Hi Dan,
I tried the xpression, it didnt work. I think for closed path it dsnt work. am so sad now. feel like am lost :'(
Copy link to clipboard
Copied
Copy link to clipboard
Copied
It looks like you left out the 6th line of the expression:
v = p.normalOnPath(L.content("Shape 1").content("Trim Paths 1").end/100);
Copy link to clipboard
Copied
Yes, My bad. I tried again. it works now, but the ball seems intoxicated. it forgets what it shud follow.
Copy link to clipboard
Copied
There's definitely something strange going on there. Could you possibly post the project file?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
I think it's because for the line, you have Transform Shape 1 Scale not set to 100%,100%. If you change it to 100%, you'll also need to change the offset variable in the expression from -100 to 100 to get the ball on the outside of the line.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
You need to change the first line of the expression to be:
offset = 100;
Copy link to clipboard
Copied
😮😮now it works!!! 😮 😮 THANK YOU SO MUCH. 😮 😮 😮