Copy link to clipboard
Copied
Hi,
when I apply an expression it starts from the beginning of the composition, but if I want to start it, for example, after 10 seconds, how can I?
Sorry for my english.
Copy link to clipboard
Copied
You can check the current time with the time variable:
if (time >= 10)
{
// your expression
}
else
{
// return the actual value you entered manually
value
}
Copy link to clipboard
Copied
Thanks for reply but I don't understand very well.
My expression is:
k=130;
a=5;
b=12;
x=k*(1-Math.exp(-a*time)*Math.cos(b*time)); [x,x]
What should I do?
Copy link to clipboard
Copied
Simply put your expression in place of "// your expression" !
if (time >= 10)
{
// This will only be executed from 10 s
k = 130;
a = 5;
b = 12;
x = k*(1-Math.exp(-a*time)*Math.cos(b*time)); [x,x]
}
else
{
// return the default value
// in this case the default value is the propertie's value but you can put whatever you want here
value
}
Copy link to clipboard
Copied
I'm guessing you're looking for something like this:
timeToStart = 10;
t = time - timeToStart;
if (t > 0){
k=130;
a=5;
b=12;
x=k*(1-Math.exp(-a*t)*Math.cos(b*t));
[x,x]
}else
value;
If you want it to start at the layer's in point, just change the first line to this:
timeToStart = inPoint;
Dan
Copy link to clipboard
Copied
Thanks Maxwell and Dan!
Now I should make an expression for a bouncing text.
I should like the bottom and width are blocked and the text appear with a bounce of Y axis.
The Y axis go from 0 to 100 and bounce...Can you help me? Do you understand?
Copy link to clipboard
Copied
There is a problem!
If I use this expression
timeToStart = inPoint;
t = time - timeToStart;
if (t > 0){
k=324;
a=5;
b=12;
x=k*(1-Math.exp(-a*t)*Math.cos(b*t));
[x,x]
}else
value;
at the first frame the scale is at 100% but it must to be at 0%!
Can you help me??
Copy link to clipboard
Copied
I think you just need to change the last line to:
[0,0];
Dan