Creating a bind-able property in UMG 4.5.1

I’m not sure if this is a possibility, but, I was wondering if there’s a way to create properties in our widgets to accept bindings.

For instance, having one of the properties in a custom widget able to have a bind when adding it to another widget.

Hello .,

I am a little unclear as to what it is exactly that you are trying to accomplish. Do you mean that you would like to have a parent widget that updates a child widget when a property in parent widget is changed?

Example: Parent widget is changed to green and so all it’s child widgets then also become green.

If this is not what you meant then could you please expound your idea?

Yes, the example you gave is close to what I want to accomplish.

I have a widget with 2 integer properties. This widget is then placed inside my HUD widget. One of those two integer properties rely on a similar property inside of the HUD widget. Currently I have it working by updating that property manually when a button is pushed, I just wanted to remove that step by adding in the bind.

Hello .,

If you would like to share information between bindings you can do so by making a variable inside the binding function and then make it a public variable.

Example:

If I bind a text block’s text to a int variable and I set that variable somewhere else then the text block will still update appropriately. I could also take that same variable and put it in another binding and this would cause both widgets to update with the same information. I hope this helps.

Make it a great day

We want to accomplish something similar like the topic creator.

We created a custom UMG widget using blueprints only: It is used to control a number value using a plus and a minus button. We need multiple of those controls in our player HUD. It has the properties: min, max, step size and value. We need to bind a function to the value and step size properties.

I searched the Engine Code and found the following snippet:

/** Whether the check box is currently in a checked state */
UPROPERTY(EditDefaultsOnly, Category=Appearance)
TEnumAsByte<ESlateCheckBoxState::Type> CheckedState;

/** A bindable delegate for the IsChecked. */
UPROPERTY()
FGetCheckBoxState CheckedStateDelegate;

I assume this CheckedState property in combination with the Delegate informs UHT to generate code such that the bind buttons in the UMG designer appear. I’m curious: Can we achieve this inside the Editor for a UMG blueprint somehow?

Have a Nice Day!

1 Like

Hello DarthB,

I am unclear as to what you are trying to accomplish and so I do not see how it directly relates to this issue. However, if you could elaborate on your goals and your issue, I will be more that happy to assist you further.

Hello Rudy,

we also want those variables to accept bindings. If the minus button is clicked we do the following in our custom “NumberWidget” Event Graph:

25997-variables.png

now we want to use this Number-Widget as building block somewhere else and we want to bind something to our Number-Widget variables in the details panel:

25998-detail.png

How can we achieve that those bind buttons also appear beside our custom variables “MinusStepSize”, “PlusStepSize” and “Value”?

We need those bindings because we have a variable that shall be doubled when Plus got clicked and divide in half if Minus got clicked.

Is this possible in BP only?

I think I got half the way in C++ by defining delegates for those variables (the bind button did appear but did not work). It seems like the bind function is never executed. I think I miss a registration somewhere.

Thank you for the quick response and have a nice Day!

Hello DarthB,

There is no way currently to get the bind button to show up using blueprints only. However, If you are wanting to update a variable on click you can use a button that has an on clicked event built in. You could then set the button’s style to the image you are wanting to use for your plus and minus symbols. I hope this helps.

Make it a great day

Sorry to necro this post 10 years later, but I stumbled over the following window in the widget editor and was thinking about that exact topic.

Although I was not able to get anything working in that window, so I was wondering if anyone knew how it should be used or if it has to do with binding properties of custom widgets?