From your Player Controller create an Event for Right Mouse Button. Create the node Get Hit Result Under Cursor By Channel. This in combination will check which visible actor is under the cursor when you right click.
Drag the blue pin and break the hit result. Drag out the Hit actor from that and Cast to your player character.
From here, you’ll want a succesful cast to create your menu (If it doesnt exist yet) and from Cast failed you can close your menu (If a menu exists).
Create Widget “YourMenuWidget” and add to the viewport. Save that widget as a variable so you can check whether the menu is open already and use the reference to close it later. Drag out the widget node and Add to Viewport.
You now only need to get the position on the viewport. From the Break Hit Result you created at the start, drag out from location to Project World to Screen. In the Player input attach “Self”. Now from the Menu widget drag out to Set position in viewport. Drag the screen position from Project World to Screen into the position of that node.
Removing it is far simpler. From the cast failed pin check if your menu widget variable is valid. If yes, from the menu widget drag into Remove from Parent.


