UMG Widget Communication

Hi there,
I am trying to solve this thing now for hours but I keep failing. Ive been digging through other Threads but somehow I havent found a solution yet :frowning:

So here is what I am trying to do. I am working on an ArchViz and what I want are slightly interactive objects that change their material. There is a tooltip at the top that describes the customer what to do. I basically have the material part, I am stuck at the UMG Part :/.
So what shall happen on the screen is that there is a ToolTip which says “click space to show interaction triggers” after that it shall say “choose Trigger” and finally once you click on the trigger a little menu pop up menu with several mat options appears and the text says “choose Material”. And the last text change, i do not get to work.
Of course in the end I want to have the same logic on basically more objects
The 1st image shows the object blueprint of my test vase, in addition I get a an Error message:
“Error Accessed None ‘UMG_Main_Tooltips’ from node SetText (Text) in graph ‘EventGraph’ in blueprint BP_bosa_cut_vase_collection_medium”
Not sure why I do get it here since I am pointing to my UMG_Main_Tooltips widget :/. How and where do I give this the information it needs?

e97cb88a33d21b0caf793259c7e102df9b6171d3.jpeg
2nd is the Widget itself
f40f8f21910cfcfb48b2c64f16c62cdbd47e2589.jpeg

3rd is the level blueprint
1d6af8f5b6d9544401fe6c70d479ddf389826375.jpeg

Since I am quite a noob here, maybe I am also having a complete wrong apporach? I saw some threads that focus on text binding etc but I have no idea on how I could use it here.
I hope you can help me.

Thanks

Daniel

hey man,

refer EventBeginPlay LvlBP: the first thing you should do is when creating your widget save it in a variable and then add it to viewport.

refer OnClicked (interaction trigger event): The same here when you create your widget save it in a variable. And to remove it from parent use that variable instead
of dragging the pin from your create widget, which will be zero, since the node never gets fired when trying to remove.

Just to be explicit give your Create Widget a PlayerController.

Confusion:

you create your UMG_Main_Tooltips widget and dont save it, but where is your variable UMG Main Tooltips (inside your red-marked area) coming from?

Hi . Thank you for your answer. I think I am a step further. So i saved the widgets in Variables. My problem is that I cannot access the Widget Variable in my object.
(The UMG Main Tooltips in my red marked area was a Variable with Type Object Reference to my Widget, which stays empty)
So I need to get my Main_Tooltips Variable from my LvlBP somehow to my Object. But my Object does not know it. And that makes me sad :frowning:

Thanks again

Daniel

heh,

now i am confused.

can you tell me which object that is?

And

So you have your UMG ToolTip Widget which you create inside lvlBP right?

And what BP Type is your other Blueprint? (with the OnClicked?)

Hi thx for the quick answer.
I explain a bit more in Detail. I am creating my Widget in the level. The Tooltip has always something in it. At first "Press Space for interaction triggers " (of several objects, furniture etc). This gets called by an EventDispatcher in the player. Then the triggers appear above the objects. Once you click on a trigger of the object it shall change the text again. Im not sure what kind of BP Type I have here. I just took a static mesh and edited the BP so I suppose it is a Static Mesh Actor (dont laugh if it is wrong, you are educating a noob here ;))
Edit:
Hm I think I am thinking this wrong. I want to send text to Textbox 105. So I need to communicate with the Widget Blueprint (see 1st post).

hmmm, direct communication between lvl and actor could be kind of tricky.

I dont quite know if there is a proper way to do this, except some ugly hacky ways.

However, since you have interactable objects in the world and each of them shall display a tooltip what you can do with it, i think the best is to
set up a tooltip text variable inside each of those.

Now, when the player enters is in range to interact with the object, the tooltip should appear. So f.e. create your tooltip event inside the PlayerController BP
and read the text out of the interactable object-> and set it to your blueprint´s textwidget.

For this you would need to replace your event dispatcher with a proper OnHit event or BeginOverlap or whatever.

Tbh… i would avoid creating widgets inside the level blueprint.

maybe this helps :wink:

Hm I see. So 1st I create the widget in the Character that is no problem. Somehow i would like to try to keep my control setup though. You see when I press Space for the 1st time I “disable” the camera mouse input so that the cursor can take care of choosing materials etc… I think with your idea, wouldnt I still have the problem that I have to send text to a widget, only in this case from the player instead from an actor. This is what I dont get. I think I am actually currently trying to get a connection between an actor and Widget. I am creating an object Reference Variable of my Target Widget but that thing is not “valid” and I get “accessed none…”. So I probably have to do something in my Widget. I simplified the actor BP for less confusion


I know its asked a lot but maybe you could show how you would send a text to a widget from another actor?
Thx again

here is my example, its just a fast way, i dont say this is the best way to do it :wink:

please note: i always used custom function, to have the logic more encapsulated and its easier to read through BP like this (my own feeling).

So except the 2 Events inside InteractableCube, i created one function for each codepart.

I havnt used the Remove inside my example but i just wanted to show you how to get rid of a widget reference :wink:

happy coding

Thanks four detailed answer. I will give this a try (maybe cry after failing and then comeback;))

have fun :slight_smile:

Thank you very much :). Sending around the functions works perfectly :slight_smile: