Changing/creating Widget animation from C++ side?

Hey so I have a widget animation that moves an object on screen n amount on Y axis.
I want it change the amount it moves depending on view port height.

I need help figuring out how can I bind to the Y transform inside the widget animation from C++ side
Or how to create a widget animation from C++ and apply it in Widget.

Please save me