Running Out of Battery Effect

That was my first idea, but can’t find a tutorial to use it in C++ since I am mostly using that instead of BP.

Can I do it in c++ or would you suggest me to just do it in BP?