Read instance's text variable for widget when triggered on different objects

Hi,

What I’m trying to do:
[long story][1]

[Another user example][2]
(there are other similar user questions elsewhere I know)

Short story: I’m trying to make a widget that is triggered by an actor blueprint, and I want the widget to display different text that reflects the public-variable-text edits I make in the editor.

My latest progress includes actors that are titled somewhat according to the hyperlinked user case above so, I have a “door_trigger” and a “doorWidget”. I have altered the pin connections so much that I am just going to copy and paste all my screen shots below.

I got to change text asset DoorName by making a public variable called “name,” as you’ll see. I can make the trigger show this text on screen and have it disappear when the user leaves the trigger actor, BUT EVERY INSTANCE ALSO SHOWS THIS TEXT VALUE, EVEN THOUGH I CHANGE IT

In the screenshots (some in comment following too) you’ll see the text “3” appear on screen, and it does this for all three of the dummy boxes I made; notice how the second box is supposed to show “dd” (I was just typing random filler content).

ALL HELP SO APPRECIATED!!! Thank you!!!

There seems to be a bit of confusion regarding how things work. In your last screenshot, for example:

  • every widget tries to access every door trigger but only the last widget set the name for the last door - and we don’t even know which one is the last once since you’re using GetAll. And you’re not even using the loop even though you’re calling it.

Rather than trying to unravel what’s going on, consider the following approach:

The widget:

The actor:

The result:

Image from Gyazo

You can set the name NewText variable for each world actor in the scene. How close is this to what you’re trying to achieve?

I literally just powered down and can’t wait to try tomorrow. Thanks for cutting through the mess and offering something anew.

On looking at it, I’m curious if you are binding your text on “Text Block 41” to anything(?). Binding text was a confusing part for me. And you’re altering text (eg “something” “mytext” “other”) in Details panel after placing the Actor in the level?

And eventually this will be made with click events, not box triggers, but I like just running and using those for RnD. For click events, the actor could be a mesh object with a click event attached in blueprint instead of Begin Overlap, right?

Thank you! As this evolves I’ll probably want to ask another question or two. Til then, will try tomorrow! Thanks heaps!!

**where I ask “and you’re altering text [eg…] in Details…” I just want to make sure, because that’s my goal.

On looking at it, I’m curious if you
are binding your text on “Text Block
41” to anything(?). Binding text was a
confusing part for me.

There is no binding, no extra variables. The only var is the one in the actor and is Instance Editable so it can be edited in the scene.

And you’re altering text (eg
“something” “mytext” “other”) in
Details panel after placing the Actor
in the level?

Precisely.

And eventually this will be made with
click events, not box triggers, but I
like just running and using those for
RnD. For click events, the actor could
be a mesh object with a click event
attached in blueprint instead of Begin
Overlap, right?

Absolutely. In addition, this method produces a widget automatically and only once. So you do not need to move the widget manually to a new location, it follows the actor. And if the actor gets destroyed, it will take the widget with them, too. The widget component used here maintains the lifecycle of the widget it hosts.

Place an actor in the scene, set the exposed variable’s value:

Image from Gyazo

Thank you! This works.

*How would I make this into a text component that could sit next to the object and display a lot of text. I don’t just want to make labels - I want instead to make a full description of something. My game purpose is educational, so you click on something and a text template pops up with a small paragraph of explanation of x object.

Thank you for your help.

I’m starting by reading this: https://answers.unrealengine.com/questions/211505/add-a-new-line-inside-a-text-var.html

seems like just ‘wrapping text’ should work… hmm

Agreed. Should work.

So… I’m using a FPS, and I’m finding it very hard to set the widget at a specific location on the screen. I would actually really like it to appear directly next to a button that I click.

Right now the widget is a component of an Actor BP that has a stylized Plane (mesh object) as a component. As alluded to earlier, I am clicking on the plane and the widget is popping up… But sometimes if I place an instance of the plane in a different orientation (facing character from side so they have to turn to look at it), then the widget doesn’t appear until I turn back to ‘forward’.

Thanksssss

So… I’m using a FPS, and I’m finding
it very hard to set the widget at a
specific location on the screen. I
would actually really like it to
appear directly next to a button that
I click.

Make the button and the text the same widget but the text is not showing. Clicking button shows text. This way you do not need to set location of anything.

As in:

Image from Gyazo

Thanks. I am chewing on this still. My buttons currently are set up in a unique way, where the plane actor essentially has a blinking border by using ‘post-process’. I’d have to review how I did it, but it’s something similar to this: https://www.tomlooman.com/outline-effect-in-unreal-engine-4/

The reason I’m doing this is because I’m designing buttons that are highlights of portions of a video the user watches.

I mention this because I’m not certain if I could equally set up the widget to have post-process appearance. Will investigate, but if you’re familiar with it and could answer yay/nay, please let me know. Cheers!

Not sure if I follow but widgets can use materials; and there’s also the Retainer Box widget which renders to Render Target. So you could apply a post process effect to a widget this way. It’s been a while since I used those (years!).

Thanks, I’ll experiment. : )