- Create a new widget called WidgetA
- Add a Text widget to WidgetA
- Select the Text widget, click the Bind dropdown, select Create Binding
- Compile and save WidgetA
- Create another new widget called WidgetB
- Add an instance of WidgetA to WidgetB
- Compile WidgetB
Gives the compile error:
“Unable To Create Template For Widget.
Fast CreateWidget Warning! This class can not be created using the fast path, because the property SourceObject on PropertyBinding references WidgetA. Please add the ‘Instanced’ flag to this property.”
It doesn’t seem to matter what kind of property binding you use. I tried it with an Image widget instead of the Text widget, binding the brush and had the same result.
I took a look at the code, and the error looks like it comes from UUserWidget::VerifyTemplateIntegrity. If the UObjectProperty has the flag CPF_Transient or CPF_InstancedReference, it doesn’t throw the error. If I mark the Text widget as a variable, it shows that it has the CPF_InstancedReference flag. Same for the WidgetA instance. The editor won’t let me set either of them as Transient. Debugging it, it seems like it is the UTextBinding itself triggering the error anyway, rather than any of the widgets.
Is there some way around this?