Skip to main content
lwjon
Participant
April 15, 2018
Answered

velocityAtTime expression error

  • April 15, 2018
  • 1 reply
  • 1821 views

Hello, I'm trying to add a simple bounce expression to my animation

but i keep getting the same errors, either this:

or this

the expression itself is as follows:

amp = 5.0; freq = 2.0; decay = 4.0;

n = 0;

if (numKeys > 0) {

  n = nearestKey(time).index;

  if (key(n).time > time) { n--; }

}

if (n == 0) { t = 0; }

else { t = time - key(n).time; }

if (n > 0 && t < 1) {

  v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

  value + v*(amp/100)*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);

}

else { value; }

    This topic has been closed for replies.
    Correct answer Roland Kahlenberg

    You've likely used this Expression on a property that doesn't contain velocity info. So, which property have you applied this Expression onto?

    1 reply

    Roland Kahlenberg
    Roland KahlenbergCorrect answer
    Legend
    April 15, 2018

    You've likely used this Expression on a property that doesn't contain velocity info. So, which property have you applied this Expression onto?

    Very Advanced After Effects Training | Adaptive &amp; Responsive Toolkits | Intelligent Design Assets (IDAs) | MoGraph Design System DEV