This tutorial explains how to create a dynamic widget that reacts to the player’s distance and the input device being used. The topics covered are: widgets, widget animations, blueprints, blueprint interfaces, and the Common UI plugin.
https://dev.epicgames.com/community/learning/tutorials/eDW8E/3d-widget-dynamic-ui-tutorial-unreal-engine