Set brush from texture not working.


Hello.
I cant get the “Set brush from texture” to work, with custom events or functions. (Refrance in the picture). The print text sucseeds.
I have already searched for an anwser, but havent found anything that would work.

What kind of element / control are you trying to change the brush / texture from? Are we talking about buttons, images, an in game mesh?

I’m using the same node in a custom event so I’m pretty sure that’s not the cause, what is the size of the image that you’re trying to replace? Is it very different from the original image? Is the alpha in the “Tint” different from 0 and the visibility set to Visible? (Asking because maybe it’s working but you don’t see it.
image

I have a button with on hover event, that is being sent to an interface (that function with a little mail icon). And used as an event here.
Im trying to set an image.
Widgets only.

Im going to try out you suggestion first thing in the morning. Epic games took over 2h to verify this post so its very late.

A solution is to get a reference to the button, then get the styles from the button. From the styles you want to Set members in ButtonStyle, add the members you want to modify. You can then split the struct of the members to change the image / texture. Finally you set the style with Set Style.


Thank for all the support, but I still cant get it to work. As you can see from the image my “Set Buttonstyle” has very diffrent parameters.
Also I may have explaind poorley, but I have an image I want to change when my custom event fires. “Set texture from brush” works only with construct and tick.

As I said in my previous comment, this is not the problem, because I always use that function inside custom events, there has to be something wrong somewhere else.
Do you have the possibility to share the project? (Or at least this part)

This prints out a text so this works.


This also prints out a text but “Set brush from texture” Does nothing.

The image im trying to change.

I tried to copy your setup and for me it’s working for me, the only difference I noticed is that your “target” pin is not yellow when you call the interface function.
Try dragging from inventory and call the interface from there.

1 Like

Thanks for all your support.
It still dosnt work, I even tried with a diffrent project. Im think im going to delete Ue5 and reinstall it.
Just one last question and then I wont bother you anymore. Did you to anything with the image? Like enable something on it?

No, I didn’t, it’s just a default image widget dragged inside the canvas.
If you want me to have a look at it (In case reinstalling UE5 doesn’t work) feel free to send me a .zip of your project (at this point I’m curious to investigate about what’s going on :rofl:), or you could share your screen in the Unreal Slackers Discord if your project contains stuff that you don’t want to share.

1 Like

InventorySystem2.zip (21.3 MB)
My project was too large. So I copied my code over to here, a new project.

I finally got it fixed. Thanks to Authaer from the Unreal Slackers discord.
Also thanks to Ares9323 and EliasWick.

For anybody wondering what the problem was then, I was using widgets badly.
Inventory->Item->NewInventory
New system:
Inventory->Item->Inventory
TLDR: I was calling a widget that wasnt even drawn to the viewport, this meant that the image wasnt visible, but the widget could still print Texts. Now looking back I realize how stupid my mistake was.

3 Likes

I’ve seen the link too late but I’m glad you found support on Unreal Slackers.
You replied while I was answering that I found your problem :rofl::rofl:

Always remember that if it prints, it doesn’t mean that it works!

1 Like

Context Sensitive Mouse Cursor Tutorial for Unreal Engine 4 | by Will Saunders | Medium I’m following this tutorial the one and only i found to setup different cursors depending from the event, and i’m also can’t add “Set brush to texture” node. P.S nevermind, i found it, i was just dumb, trying to create it dragging from the event, instead of doing it from my cursor image variable :smiley: