Playing Animation in C++

Hey,

I have created a logic in C++ that changes the intensity of a ALightActor after pressing E as OnInteract in an InteractionBox. I wanted to add an animation to the lever that would switch on and off after pressing, but it is impossible for me to do in blueprints and does not work. What should I do in the c++ so the animation plays after pressing the same button as turning the light on? Or how do I just address it in the file since when I tried to do that in blueprints it just did not work for InputAction→PlayAnimation. How do I define which animation from the content browser should be used in c++?