Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Animate object along animated path

  • Animate object along animated path

    Posted by Robin Munshaw on October 12, 2019 at 12:33 am

    Hi there,

    I’ve created a path that has vertices animated to follow an underlying map. The map is a slow zoom in on Google Earth looking at the ground at about 45 degrees, so each vertex of the path is keyframed to follow a point on the map to allow for perspective shift during the zoom. This path will be an animated route on the map.

    I’m now trying to make a glowing dot follow the path as it’s revealed – is there a way to make an object follow a path that is itself animated with keyframes? The only tutorials I’ve found show how to paste a static path into an object’s position attribute, then animate the object along that fixed path, but this method doesn’t allow for a path with animated vertices.

    Thanks for any help!

    Andrew Jehan replied 4 years, 4 months ago 3 Members · 5 Replies
  • 5 Replies
  • Dan Ebberts

    October 12, 2019 at 6:55 am

    Assuming that you’re using Trim Paths to set the end point of your path, an expression like this (for the position of your dot) should track an animated path:

    L = thisComp.layer(“Shape Layer 1”);
    path = L.content(“Shape 1”).content(“Path 1”).path;
    pct = L.content(“Shape 1”).content(“Trim Paths 1”).end;
    L.toWorld(path.pointOnPath(pct/100,time))

    Dan

  • Robin Munshaw

    October 13, 2019 at 5:59 pm

    Ah this worked perfectly, thank you so much!

  • Andrew Jehan

    March 15, 2022 at 7:13 pm

    I’m getting a “syntax error” on line 1 (see screenshot). Can you help?

    Thanks!

  • Dan Ebberts

    March 15, 2022 at 7:19 pm

    You probably just need to swap out the curly quotes for straight quotes:

    L = thisComp.layer("Shape Layer 1");

    path = L.content("Shape 1").content("Path 1").path;

    pct = L.content("Shape 1").content("Trim Paths 1").end;

    L.toWorld(path.pointOnPath(pct/100,time))

  • Andrew Jehan

    March 15, 2022 at 7:43 pm

    That fixed it! Thanks!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy