whats the best way to display hint text when looking at specific objects?

I am making an investigation game in which you play a robot on a space station. you can “focus” by holding the spacebar. i would like there to be hint text and a ui that appears on screen when focusing on specific objects. what i have so what is the best way to go about doing the text? should i create a separate text box for each hint object, or is it possible to update one textbox with new text? the line of sight will be tracked through a long collision box.
currently what i have, the robot stops moving when spacebar is held and the camera zooms in. at this point the ui should appear. i am new to blueprint scripting, so any help would be appreciated.

1 Like

Hey @BogDog9! Welcome to the forums!

So you will probably want to find a tutorial of some kind, but make sure of this:

To destroy a widget- you will need to use “Remove from parent”. It’s somewhat of a misnomer.

Create Widget-> SetText (make sure the widget has the text variable exposed). → Add to Viewport (I think that’s the name- bear with me there are thousands haha)

You should only need the ONE widget for the pop-up, so make sure to kill one before adding the next.

You can either feed in screen coordinates, or give each object (through parent class would be best) a floating widget component location to spawn it.

Using that, you can have that actor component (or scene component) use a “LookAt” node with player location as the target to make sure it always faces the player.

There is a lot to UI design, I suggest getting into it, it can be a HIGHLY rewarding thing to learn in-depth! :slight_smile: