Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Inertia bounce expression – error: velocityAtTime is not a function

  • Inertia bounce expression – error: velocityAtTime is not a function

    Posted by Georgia Dowling on April 10, 2019 at 2:57 pm

    Hi,

    I am pretty new to After effects and entirely new to Expressions, I have tried to use this expression on a shape but I get this error message:
    After Effects warning: Expression Disabled
    Error at line 14 in property ‘Path’ of layer 1 (‘TP button Outlines) in comp ‘Tp button’.
    TypeError: velocityAt Time is not a function

    Can anybody help?

    Thanks!

    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);
    amp = .05;
    freq = 4.0;
    decay = 8.0;
    value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
    }else{
    value;
    }

    Kalleheikki Kannisto replied 7 years, 1 month ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    April 11, 2019 at 8:01 am

    I believe velocityAtTime() is a property to be accessed in this manner:

    myLayer.position.velocityAtTime();

    i.e. you want to pick whip your layer for the beginning part and add .position (if you want the velocity of the change in position, rather than change in rotation, or scale) and then the rest of the code in that line.

    I didn’t investigate the full code, but that should at least address the error message.

    Kalleheikki Kannisto
    Senior Graphic Designer

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