Skip to main content
brandonb96942845
Inspiring
March 16, 2023
Answered

Help with Nested IF/ELSE Statements

  • March 16, 2023
  • 1 reply
  • 560 views

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.

This topic has been closed for replies.
Correct answer brandonb96942845

Figured out the problem--I should've used "==" instead of "="

1 reply

brandonb96942845
brandonb96942845AuthorCorrect answer
Inspiring
March 16, 2023

Figured out the problem--I should've used "==" instead of "="