The latest big variable update, launched in December, included layer opacity. In the video posted by the Figma team, you can see how you could add an opacity variable to the layer control in the right panel. Very straightforward.
– But, I don’t have those settings next to the layer control. Does it work for you?