Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Adobe After Effects Expression help – movement by object proximity

  • Expression help – movement by object proximity

     Tim Wilson updated 1 month ago 3 Members · 5 Posts
  • Daniel Poffley

    April 12, 2021 at 10:13 am

    Hi all. Can anyone help me with this one?

    Imagine a comp with two circles.

    Circle A is moving around randomly.

    Circle B is static.

    When circle A moves near to circle B (lets say within 200 pixels), I would like circle B to move away in the opposite direction, then return to its start position when circle A is over 200 pixels away.

    I’ve found several scripts, but they always seem move the circle in a specific X/Y direction rather than away from the other object.

    Does something like this exist?


  • Ben King

    April 12, 2021 at 10:20 am

    The Newton 2D physics engine for AE might be worth looking at…

  • Daniel Poffley

    April 12, 2021 at 10:28 am

    Thanks Ben. I’ve not heard of this plugin before. I’ll take a look.

    I am wondering if there is a way of doing this without plugins.

  • Daniel Poffley

    April 12, 2021 at 11:58 am

    Found it.

    You can set an expression so square B always faces square A, then modify its anchor point, which will push it away in the opposite direction.

  • Tim Wilson

    April 13, 2021 at 5:48 am

    Wow, very elegant indeed! Thanks Daniel!

Viewing 1 - 5 of 5 posts

Log in to reply.

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