There’s lots of info on the web generally on this so I’ll try and offer a brief outline. Not sure how much of this you already know so let know if you want more specifics on anything.
You first need a layer to hold your checkbox, this is an Expressions effect. I usually add a blank Shape layer but you can use a null layer or any other layer too. I rename it “Controls” and then right click on it and go to Effects > Expression controls > checkbox
Now open a layer you want to control with the checkbox, work out which property you want to change and Alt + click on the stopwatch sign for that property. This will open a code panel for the property. For instance if you want to move the layer, you might want to open the Position property in the Transform section. Or you might want to change the Scale property etc.
In the code panel you just opened, type:
var check =
and then you’ll see a little twirly spiral symbol near the code panel. Click and drag it to the checkbox effect you added to the Controls layer, and it will automatically link it to the “check” variable. The code text should look something like this:
var check = thisComp.layer("Controls").effect("Checkbox Control")("Checkbox")
Now you can do a simple if statement. The “check” variable will link to the checkbox, and the value will be 0 (zero) if unchecked or 1 (one) if checked. Thus:
var check = thisComp.layer("Controls").effect("Checkbox Control")("Checkbox");
var pos = [0,0];
if (check == 0) {
pos = [200,300];
} else {
pos = [400,600];
};
pos
When you check the box on or off, it will change the position variable in this script. The position is an array of 2 numbers hence the use of square brackets to encapsulate the x and y position. Putting the pos variable at the end basically returns the value of that variable for the layer to use.
That’s the basics of using a checkbox to control expressions. Play with that for starters – do you need some more tips on how to set up the keyframing too?