Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression needed to make side of cube mirror/reflect movement of opposite side of cube. Eg. Sides fly out.

  • Expression needed to make side of cube mirror/reflect movement of opposite side of cube. Eg. Sides fly out.

    Posted by Lee Midwinter on March 20, 2016 at 8:16 pm

    Hi,
    I am pretty new to AE.

    I thought I would be smart making a spinning cube with the opposite sides flying out then rejoining the cube (one side mirroring the movement of the opposite side).

    I smuggly made my cube with all sides parented to a null object to make it spin. All good so far. Then I pick whipped one cube side’s ‘Position’ to it’s opposite side’s ‘Position’, naively thinking that would somehow magically know I wanted the opposite side to reflect the actions of it’s parent. It obviously didn’t. It exactly matched the cube side making my cube look like a side was missing (because two sides were now on the exact same coordinates).

    I need to make the side reflect the parented solid’s actions rather than copy it. So for example, if the parent moves 400 in one direction I need the opposite side to move 400 in the opposite direction. Sadly I have no clue how to write this.
    Pretty sure this is easy for people on here.
    I am out of my depth.
    Help.

    I have included the code which makes it exactly copy the movement. What do I need to add or change?

    Thanks in advance.

    thisComp.layer("side 2").transform.position

    Lee Midwinter replied 10 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Kalleheikki Kannisto

    March 21, 2016 at 7:42 am

    You need the position to be a negative of the distance from the null (assuming your null is in the center of the cube).

    thisComp.layer("Null 1").transform.position+(thisComp.layer("Null 1").transform.position-thisComp.layer("Your other layer name here").transform.position)

  • Lee Midwinter

    March 21, 2016 at 10:26 am

    Yes!
    Great, it works!

    Thanks a lot Kalle.

    L

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