ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Inertia bounce expression – error: velocityAtTime is not a function

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Georgia Dowling
Inertia bounce expression – error: velocityAtTime is not a function
on Apr 10, 2019 at 2:57:08 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 &lt; 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;
}


Return to posts index

Kalleheikki Kannisto
Re: Inertia bounce expression – error: velocityAtTime is not a function
on Apr 11, 2019 at 8:01:36 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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]