Place widget in a 3D space

Hello! I am new to unreal and not very familiar with bp yet. I have created a button that reveals text by clicking it, using the bp widget, but I would like to place it in a 3D space so that it works with a sort of popup for some information about objects in the scene. What is the easiest way to be able to do this?
I have tried placing the widget inside a bp actor to place it in the scene, but it also becomes visible the text as well as the button, whereas I would like it to still maintain the logic of the widget i.e., that the text appears only after clicking the button.

Thank you very much!

You will want a widget component for this. Text is initially hidden:

image

Button shows it:

image

A component is added to an actor and set to World Space:

Ensure this is on in order to enable mouse interaction:

image

2 Likes

Hi! Thank you for your reply and I have tried the process but unfortunately it doesn’t work. When I click, the text doesn’t open

Can you show the script and the widget hierarchy? The above does this:

This is what you’re after, right?

You can also use “Widget interaction component” on your character/pawn to interact with widgets in 3D space, while playing. There you will find some interaction events and settings for the pointer.

Do not forget to turn debug ON, to see the pointer

Perhaps this is the right question to ask - @FabianaCarboni are you using mouse cursor to click or you want to look at something and “click” the thing that’s in the middle of your screen?

In which case @DoggyDog’s suggestion is spot on.

1 Like

No, I’m using the mouse cursor to click on the button and this is the hierarchy


If you want to hide / show border, ensure the text is visible.

  • the border should be initially hidden → button shows it, you got this
  • but your text is hidden so probably just the border shows up - although the border seems see-through so it’s hard to tell…

Essentially, you must decide what you want to show / hide. The entire border with text or just text.


Also, please clarify if you’re using mouse cursor to point at things.

1 Like

Yes I am using the mouse cursor and indeed you were right I had the border visible while the text was hidden, sorry! You solved it, thank you very much

2 Likes

Nice one!

Sorry I just have one more question, in play the text seems a bit grainy… how can I improve it?

Immagine 2023-03-14 191055

In your 3d widget component you can increase it’s resolution, and inside the widget itself you should probably make the text LARGER

1 Like

Thank you very much!! :smile: