You could create an empty actor and put in a collision box and On Component Begin Overlap cast to your character and create a widget through a function in your character.
You could also set a boolean to true on the begin overlap while casting to the character so that the input action can only be ran if inside the collision through the use of a branch with said boolean. You can set it back to false and remove the widget with the On Component End Overlap so they don’t see the widget or can’t run the interact function either.