• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit Search
0

Help with Nested IF/ELSE Statements

Contributor ,
Mar 16, 2023 Mar 16, 2023

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.

TOPICS
Error or problem , Expressions , How to

Views

105

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Mar 16, 2023 Mar 16, 2023

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

Votes

Translate

Translate
Contributor ,
Mar 16, 2023 Mar 16, 2023

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines