Copy link to clipboard
Copied
Hello,
I am following one tutorial 'VERBATIM'. I applied the same expression as my tutor used. but he got no error, I got. :'( why?
There is no Math.Pl function. It's Math.PI
Try this:
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;
}
n = nearestKey(time).index;
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time) - thisComp.frameDuration / 10;
amp = .45;
freq = 4.0;
decay = 8.0;
value + v * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);
}
else {
value;
}
When you have problems with an expression, it is a
...Copy link to clipboard
Copied
There is no Math.Pl function. It's Math.PI
Try this:
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;
}
n = nearestKey(time).index;
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time) - thisComp.frameDuration / 10;
amp = .45;
freq = 4.0;
decay = 8.0;
value + v * amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);
}
else {
value;
}
When you have problems with an expression, it is a good idea to use the toolbar's </> tool to post the expression. When you have problems with a tutorial, it is always helpful to post a link to the tutorial. Unfortunately, most of them are presented by enthusiasts, and the workflows and explanations can be a little sketchy.
Copy link to clipboard
Copied
Thank you so much. I will remember what you said. Thank you.