It’s often pretty useful to be able to access UMG-created animations from C++.
Especially as you move more and more logic from Blueprints into C++, UMG
animations can seem like the last hold-out.
With a custom subclass of
UUserWidget, we can create a map of
UWidgetAnimation* and access the animations by name from C++.
Let’s see how to do this:
- Our PlayAnimationByName isn’t entirely needed, but it can be a helpful wrapper
for the regular PlayAnimation function