Add Component in Actor hierarchy

I am trying to add a static mesh component to an actor.

I have a simple actor component that does this, however, the new component doesn’t show in the hierarchy of the actor.
But when I use the “Add” component button on the details pane it does appear in the hierarchy.

in addition, whenever I rerun the construction script on my actor (by moving it) the component is destroyed…this is not the case when using the “Add” button.

How can I create a permanent actor component that appears in the hierarchy?

Disable this:

And this:

image

Then restart the editor.

2 Likes

Thanks, the component now appears in the hierarchy after creation! (just have to click off the actor and back to it)

But the component is still destroyed when the construction script runs (via any method) which I want to prevent.

How can I save the newly added component as a permanent addition to the actor?

Are you using C++?
If so, I’m pretty sure you need to use AddInstanceComponent to make your component stick around

You can use Subobject Data Subsystem to add components with EditorUtilityWidget or EditorUtilityBlueprint. It’s a more complex method that allows you to manage components in the blueprint and outliner. However, it requires some skills.

My Products

1 Like