UE4 C++: CREATED CHILD WIDGET INVISIBLE???

Hello! I want to create a child widget during runtime (images, textbox, etc) but when I create the widget, it doesn’t show up. The pointer to the created widget is valid, so it did create the widget but it didn’t display it. Here is my code: UWidget* ChildWidget = NewObject<UWidget>(UserWidget, WidgetClass, WidgetName);. Is there another function I need to call? Thanks!

Hi! After you create UWidget, to see it you should Add it to Viewport with AddToViewport or to Parent which is added to Viewport by AddChild methods (ref Creating Widgets | Unreal Engine Documentation).

I used AddChild() earlier which solved it and turns out it was in the viewport but it was just really small.