Hi i dont know how to do it but from the start in this picture this is my UI and it works but how to do it when i click 1 on the keyboard it is supposed to change the in-game image from black to one of these
Hi, do you want to pick a random image or do you want display an image that you click?
If you want a random image, insert a “on clicked” event at the black square.
In the other case, the “on clicked” event needs to be on the clicked image.
To make everything easy: for the “on clicked” event you need a “Button” element, not an image. With an “Overlay” element, you can insert a trasparent button above an “Image” element.
Once you have that, from “on clicked” simply use the function “Set Brush from Texture”.
Hope it helps!
Ah, sorry! I misunderstood: was thinking that you wanted an image change when you press 1 image… instead you want the image to change when you press the keyboard 1.
You can handle keyboards from Player Controller!
So you need an event there and link it to the widget.
Sorry but how to do this ? how to link it to the widget
I have attached an example from my current project. I edited the image so that it applies to your case.
- The red button is your event keyboard 1.
- From there you insert the node “Create Widget of Class”
- On that node, you’ll see a place (pointed by the green arrow in my image) where you can select the widget you want to manage.
- Promote the Return Value to a variable.
- From that blue output (pointed by the yellow arrow) you can either call a function that is inside your widget or make the entire operation on your Player Controller
Wait you mean on my third person characet for example (blueprint), and ok but how to do this on for example separate object not on player controller blueprint (actor blueprint)
Actually it’s on the Player Controller, not on the Third Person Character.
You can place the widget wherever you want, it’s only the event that resides on your PlayerController. And before you can use a widget you have to run the node “Create Widget”, which you can do in your Controller.
I have screen on my actor blueprint and its not working, sorry but i am beginner
No problem
This has to be on the Controller, not on the character
Its not working also (on player controller)
Ok, I made few screenshots to explain everything in the detail.
First things first. If you don’t have a Player Controller, create one:
Then, assign the Player Controller in your ThirdPersonGameMode:
If you already have a Player Controller working, you can skip those first 2 steps.
After that, insert a Custom Event into your widget:
Then add these nodes:
Replace “Image 0” with the actual name of the image you want to change.
Then, in your Player Controller, insert this:
This should work

I cant find set brush from texture in UI event graph
Drag your image reference (in your widget blueprint) to the graph. Then, from that, drag its pin and search for Set Brush From Texture
Yes its working great thanks man
You’re welcome