Add a button above an interactable when you can interact with it

Hi everyone,
I’m making an open world type game on UE5. To improve the user experience, I wanted to add a button above the interactables when the player is in range (see screenshot).


I started by making a collision sphere that detects when an interactable is in range but I’m stuck displaying the button above the object.
The game is in cpp but if you have an answer in blueprint I would be really happy :slight_smile:
Thanks :slight_smile:

Hey @Tenshii! Welcome to the forums!

So, on the interactable actor, you need to add a widget component.

You’ll want to download the image you want to be displayed.

Next you will set that image as the texture for the widget, and you’ll want to place that where you’d like using the viewport.

Once you have it set where you’d like, click on the widget component and go over to details, and check “Hidden In Game”.

Then, once you get within the collision (which I assume you have in place for the interact button), Enable Visibility on the widget “TRUE”, and using OnCollisionEnd use another Enable Visibility node and set it to “FALSE”.

Hope that helps! :slight_smile:

1 Like

Thank you very much, that’s exactly what I was looking for

1 Like