Copy link to clipboard
Copied
Hello
My apologies I am a beginner with expressions. I can't figure out why I am getting an error for this line:
if(comp("Final comp").layer("Control layer").effect("Glitches on/off")("ADBE Checkbox Control-0001")==1) 50 else 0;
Any insight would be much appreciated.
Copy link to clipboard
Copied
Conditional statements require curly brackets:
if (condition)
{do A}
else
{do B}
The sloppy syntax you are using is only supported by the legacy expression engine, but since it's deprtecated and one day will simply disappear you better learn how to do things correctly from the outset. It's also good practice to funnel references to controls into their own variables before using them in the code:
mGlitch=comp("Final comp").layer("Control layer").effect("Glitches on/off")("ADBE Checkbox Control-0001");
if (mGlitch == 1)
{50}
else
{0}
Mylenium