I’m trying to create a nice looking sorta… futuristic(?) UI through a widget blueprint in Unreal Engine, but it seems as if I can not change the shape of a button’s hitbox?
Here’s a screenshot of a button that I added an image to and its hitbox, in green.
After doing some research I’ve come across a couple of people mentioning that it is not possible to edit the button’s rectangular shape to fit your image’s needs using UMG, and that to do so you would probably need to purchase a plugin from the marketplace, but it seems like such a simple and necessary feature that I decided to ask around myself about any workarounds or solutions…?
Hi! Thank you for posting this! But I have a runtime error says :
Blueprint Runtime Error: “Accessed None trying to read property ButtonRenderTarget”. Node: Read Render Target Pixel Graph: SwitchByAlpha Function: On Mouse Move Blueprint: RightClickBodyTypeButton
This is fantastic! The only issue is that there is still ultimately a square bounding box around it, and if the bounding boxes of two buttons overlap, one of the buttons won’t work (in other words, you can’t click “through” the transparent part of a button)
Thanks for the tutorial! I’d like to add that you should override OnMouseButtonDoubleClick and copy the functionality from OnMouseButtonDown. That will fix an issue where spamming the button causes it to miss every second down event.
Hello !
Thanks for the tutorial and the file ! This is really helpful !
However I have a question, regarding my needs for a project.
Let me explain in details:
1-I am making an rpg in which you have many companions.
2-However, when you go on a quest, you limit the number of companion that are following you. To do so, I have a widget that open so I can select my companions.
3-Once in the game, the main character and the companion are playable. Meaning I can switch from a character to the other.
4-To do so, I am using buttons on a 2nd widget (an HUD basically). And each of this button have the face of the character.
My problem is: the button on the 2nd widget that have the faces of the companion, has to change and be updated, depending on the companions that are selected from the 1st widget. I have tried many things, but I could not find a way to make the pictures (normal, hovered and pressed) getting updated based on variable or event from anoter widget or blueprint. Is there a way to solve this?
I’d like to suggest checking out the Custom Shape Button open-source plugin on GitHub. It’s designed to work right out of the box—simply choose a texture with an alpha channel or a material with an ‘Opacity’ input. You can also find documentation and download a sample project to see how it works.
This is great, many thanks.
To compleat your work I changed the “zorder” of the parent slot depending of the mouse position on the widget, in order to overcome overlapping issues.