Skip to main content
Patrick Lomasney
Inspiring
Nov 9, 2021 2:23 PM UTC
Answered

If else and If else if else expressions not working

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

This topic is closed to new replies. Start a new post to keep the conversation going.
Mylenium
MyleniumCorrect answer
Legend
Nov 9, 2021 2:30 PM UTC

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

 

Mylenium

2 replies

Mylenium
MyleniumCorrect answer
Legend
Nov 9, 2021 2:30 PM UTC

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

 

Mylenium

Translate
Patrick Lomasney
Inspiring
Nov 9, 2021 2:37 PM UTC

I can't thank you enough

Translate