Hello,
I’m having a bit of troubles trying to override the properties of a Widget that is component of another Blueprint.
The use case I’m referring to is the following:
- Create a Blueprint (“MyBlueprint”)
- Add a Widget as Component (“MyComponent”)
- Create a Widget (“MyWidget”) with just a Canvas and an Editable Text
- Set “MyWidget” as class of “MyComponent”
- In the Construction Script of “MyBlueprint”, override the text of the widget as follows:
After Blueprint compilation, something weird happens: the Blueprint editor shows the correct text (the one set in the variable), while in the scene the text is still the default (set in the UMG editor).
If I move the actor around triggering the Construction Script, the text becomes correct in the scene too. But, if I recompile or change any default value of the Blueprint (not just the text variable), the text reverts back to the Widget default.
I checked that the Construction Script is actually called even when the displayed text has been reverted to default, but it’s like the text override gets ignored/discarded. I’ve got the idea that the Construction Script manipulates a Widget instance that later gets replaced by a new one (are Widget mutable at all?), but I might be wrong.
Can someone please tell me what am I doing wrong? Thank you.