So I have a text variable in every Actor necessary. the Text Variable is “Name” I have setup a widget with a Text variable that uses the Text Variable from the Actor and sets the name of that variable and applies it as the text in the widget display.
Expected result: The Widget should pop up showing the Name variable.
Therefore whatever name I give to the Actor’s Name Variable, the Widget will set that as the text to display in the widget.
Reality: The widget appears over every item that is not the same actor or class of Actor.
If you can see, this is the function I set for the interaction widget to get the name variable from the Actor the playercharacter overlaps with.
Two things I noticed here:
The same name appears over everything because the first integer value / element in the array index is the first actor the function picks up. The result is that now every other object a name other than Nathan will have the name Nathan, Think of it as a Baby learning it’s first words. it learned the word Apple for the first time, and now it goes around calling everything else Apple LOL.
One other weird thing I noticed is that I have a Dialogue box that shows the name of the speaker; and when I approach the NPC, their name appears in the Dialogue box as expected! What makes this weird is that there’s no fancy Blueprints being added to the Widget OR the NPC actor. just reference the NPC actor in Widget get the name variable, and set text of the Dialogue box to the NPC Name, and it works; but for the interaction widget, no good.
Here’s that example Below:
Hello!
could you tell when the interaction is supposed to happen?
Whenever the player nears it / overlaps it’s collision field ie, “when the player approaches the NPC” as you said.
and when the player moves away, the widget disappears
Yep
are you using widget components for this?
Yes.
and what is the setup - each actor has its own widget, right?
Each Actor has their own Widget Component.
Hopefully I can post more screenshots in the Comment section.
w
I didn’t wanna do binding text because I heard it’s not good for performance. Yet I see so many people try this so I avoid it. I’m stuck because I don’t wanna move forward with this until I am certain of this.
I didn’t wanna do binding text because
I heard it’s not good for performance.
Yet I see so many people try this so I
avoid it. I’m stuck because I don’t
wanna move forward with this until I
am certain of this.
This depends on what you bind and how you do it… If you worry about performance, you should definitely avoid GetAllActors types of nodes. Just read the tooltip it comes with