ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Checkbox OFF to trigger animation

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Pedro Amaral
Checkbox OFF to trigger animation
on Jul 23, 2018 at 1:23:00 pm

Hi,

I have this expression set up with time-remap to trigger one animation IF the checkbox is On:

n = 0;
p = comp("Controller").layer("Death").effect("Player 01")("Checkbox");
if (p.numKeys > 0){
n = p.nearestKey(time).index;
if (p.key(n).time > time) n--;
}
if (n > 0 && p.key(n).value)
time - p.key(n).time
else
0


However, I'm trying to get it to work only when the checkbox is turned OFF.

I've tried changing things around in the expression but haven't been able to figure out what part of the expression is dictating the True/False of the Checkbox.

Any ideas?

Thanks in advance!


Return to posts index

Alex Printz
Re: Checkbox OFF to trigger animation
on Jul 23, 2018 at 1:59:13 pm

try this:

n = 0;
p = effect("Player 01")("Checkbox");
if (p.numKeys > 0){
n = p.nearestKey(time).index;
if (p.key(n).time > time) n--;
}
if (n > 0 && p.key(n).value == 0)
time - p.key(n).time
else
0


Alex Printz
Mograph Designer


Return to posts index

Pedro Amaral
Re: Checkbox OFF to trigger animation
on Jul 23, 2018 at 3:06:39 pm

Awesome!

Thank you so much Alex


Return to posts index

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