Add Component node not adding the component to the hierarchy?

I’m trying to add a widget component through the blueprint event graph or construction script, but the “Add Widget Component” doesn’t add a widget component to the hierarchy, i tried with other add component nodes but none of them seem to add components to the hierarchy like the “Add Component” button does…

I also see there’s a “Manual Attachment” bool on the node but i have no clue how to use it.

I assumed that the “Add Component” nodes would do the same thing as the button and add a new component in the components hierarchy. But that’s apparently not the case.

When you add a component via blueprint nodes, it won’t show up in the Add Component section, but it is still being added. You can test this yourself by getting the “Return Value” of the Add Component node, then calling the Get Owner function (retrieves the actor to which a component is attached), and printing it. It should print the name of your actor.

Similarly if you want to know which component is above your widget in the hierarchy, you can call Get Attach Parent instead of Get Owner.

Thanks for the response, I tested what you said and it does work. But i’d really like to be able to see the widgets in the viewport & the hierarchy otherwise there’s no point in adding a world space widget if it’s hidden as a reference in the back-end right?

Maybe it is in the viewport but i have no way of knowing where it is since it’s invisible? I created a user widget asset that has the visuals for the widget, and i know how to assign it when i select a widget in the hierarchy but i don’t know which blueprint node to use to assign it in the event graph.

Alright so if I understand correctly, you are dynamically adding a Widget Component and want to assign your custom User Widget to it. If that is the case, try using the Widget Component’s “Set Widget” node. You can use the “Create Widget” node to create your widget and pass it on to the Set Widget node.

Also, if you are certain of the Widget class that you are going to use beforehand, then its even more easier. Just click on the Add Component node and you’ll see the details panel on the right.

From there, you can set the widget class similar to how you do it from the hierarchy.

I somehow completely glossed over that you could set the details for the node there. well i guess that solves everything as i don’t need the hierarchy to see the details, it all seems to work now thanks!