After Effects expressions - pendulum motion not working properly
Hello,
I am trying to make a triangle shape in After Effects swing in a pendulum motion which decays. This is the expression I have used:
timeToStart = 8;
if (time > timeToStart)
{ Math.sin((time-timeToStart)*10)*50/Math.exp(time-timeToStart)
; } else {
; value
}
The problem that I am having is that after the 8 second mark, the triangle returns to the original position it was in, before I put the code in. To explain better, at the beginning of the animation the triangle does a circular rotation and then stops in a specific almost horizontal position. And what I want it to do after it does that circular motion, at the 8 second mark, is swing down from it's horizontal position to a top down position (meaning that the long pointed end of the triangle is pointing up). The anchor point is in the long point of the triangle which is pointing up. I hope that makes sense - I want it to swing down from it's anchor point in a pendulum motion which decays until it is still in a completely vertical position.
However what is happening is that the expression I have used overrides the rotation and causes the triangle to jerk up into its original almost horizontal position, and then it does the pendulum-decay-animation. The animation is perfect, but the position is wrong.
Any idea on how to fix this? Hopefully this wasn't too confusing to understand 😕😕
