How to display a widget and play an animation on a button press?

I would like to display a widget to the screen and play an animation that I created of that widget at the same time when the player presses E. What is the best way of doing this? Thanks.

You can either have the player controller handle input:

E key → Get reference to the widget → Get animation → Play

… or have the widget handle it instead - useful if you’re running UI only mode:

Override onKeyDown, return Handled.
Override onKeyUp, Get animation → Play

If you don’t already have a widget you can create one.
instead of get reference, you would do “create widget” and “add to viewport”.