Make a flashlight shake while the player moves

These are also what I were thinking about to achieve the shake movement .
Why didn’t they work,I’m curious.

EDIT:
Is it possible that you animated the wrong component?
Because I saw your hierarchy,the light is not a child of the flash mesh.
Did you animate the light?
I’m sorry if it is stupid.