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

If else and If else if else expressions not working

Explorer ,
Nov 09, 2021 Nov 09, 2021

I have this expression:

if (thisComp.layer("Driver 1").text.sourceText = "HAMILTON" ) {

100;
} else if (thisComp.layer("Driver 1").text.sourceText = "BOTTAS" ) {
100;
} else {
0;
}

It is linked to an opacity control and is not working.  The opacity is always on 100% even if the text isn't 'HAMILTON' or 'BOTTAS'.  Anyone know a fix?

Thanks

TOPICS
Error or problem , Expressions , FAQ , How to , User interface or workspaces
325
Translate
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

LEGEND , Nov 09, 2021 Nov 09, 2021

Comparisons require logic operators, not assignments. You need ==, not just =.

 

Mylenium

Translate
LEGEND ,
Nov 09, 2021 Nov 09, 2021

Comparisons require logic operators, not assignments. You need ==, not just =.

 

Mylenium

Translate
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
Explorer ,
Nov 09, 2021 Nov 09, 2021
LATEST

I can't thank you enough

Translate
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