When you parent one layer to another, many properties work in sync. However, opacity does not. To inherit parent opacity, you could use the pickwhip to inherit the value. But, making an expression in After Effects allows for more options.

To create the initial expression, set a keyframe for the layer you have set as the child. Create an expression for opacity. Then, type the following:

(hasParent) ? parent.opacity:value;

This checks for a parent, and if there is a parent, it uses the parent’s opacity as the value for the layer’s opacity.

This really comes in handy if you want to adjust this value further. For example, you may want the opacity to go up or down based on the parent layer, but at a different rate. You can alter this expression accordingly.

(hasParent) ? (parent.opacity/100)*50:value;

This expression makes the child layer’s opacity at half of the parent layer’s opacity.

So, with just a little math, you have an easy way to control the inherited opacity.

Enjoy the short tutorial video below: