I’m trying to extend UUserWidget in order to create an in game menu that I can manipulate with both C++ and blueprint. I’ve got my base class compiling, but I’m attempting to add a series of buttons to my widget that will auto populate when I create a new blueprint, akin to a default sub object in an object blueprint.
As such, I am working in the constructor, trying to create the button widgets and see them in the widget blueprint editor.
I have tried CreateDefaultSubobject, but that doesn’t add them to the Canvas.
I have tried GetSlotNames(), but it causes an access violation.
I have tried to access the Canvas directly, but can’t find where it has been added, as it is not referenced in either UUserWidget() or UWidget(), and if I do GetWidgetFromName(FName(TEXT(“Canvas Panel”))), I get an access violation.
Supposedly I can call AddChild, but UUserWidget has no such function, nor can I find one.
Does anyone know how to solve this issue?