I have a working blueprint that swaps materials on the floor whenever I left-click and I want to connect this to the widget where a border elelent will appear around the corresponding thumbnail. Here is a video of what it looks like:
As you can see in the video, I would like a white border to highlight the corresponding thumbnail. I created an event with an Integer as an input variable and a different number is assigned to each material. I just don’t know how to get this firing off in my widget blueprint. I am trying to bind the “Is Enabled” option but I’m lost as to how to activate it from the other blueprint.
My material swapping blueprint looks like this:
And my widget looks like this:
In case like this i use system like “widget inside widget”, more detail you can know in InventoryUIwithUMG in Lern tab.
Or why you are not using buttons with image inside?
It looks like the cast nodes isn’t connected in the material swapping blueprint. If you want to make them pure, you can right click on them and convert them to pure functions.
Also, you need to select which widget you want to get under “Widget Class” on the Get all widgets of class node.
Im not using buttons because I dont want to use the mouse cursor as the mouse cursor is used only to steer the player. I want the left click or a key to send the event to swap materials.
Thank you for your response. I thik I fixed the cast node connections. I right clicked on the cast nodes and selected “pure cast”. I also connected the “Get All Widget Classes” nodes to the “Color Changed Events”. Now my question is how to set up my widget blueprint to receive the events.
I hope I understand you correctly, and I don’t know if this is the best solution, but it should work. It looks like you already have a custom event in the widget itself. From that event, promote a variable from the int.
Then, on one of your borders create a binding under visibility.
In that function you could do something like this.
Then of course do the same with the other borders, but visible with another int.
This does the job! Thanks a lot!