Copy link to clipboard
Copied
I have a question about how to structure an if/else statement (or equivalent) with multiple conditions. Short version, I have a counter that counts from 0 to 100, and what I'm trying to tell AfterEffects is this:
"If the counter is at value 0, then set the value to a specified variable. If the counter value is at 100, set the value to this other variable. And if neither of those is true, set the value to this third variable."
This is how I've got the syntax structured (temp3 is the counter value):
if (temp3 = 0){
temp1;
}else{
if (temp3 = 100){
temp1 + temp2
}else{
temp7}
}
When I set it up like this, no matter what the value of the counter, the value seems to be stuck on (temp1 + temp2), so obviously I've got something wrong.
Figured out the problem--I should've used "==" instead of "="
Copy link to clipboard
Copied
Figured out the problem--I should've used "==" instead of "="