[Editor Utility]Adding component to actor in level

Hi i’m trying to make an editor utility that adds an ActorComponent to objects I have selected in the level. The problem is that the component added never is visible in the details panel, but if I iterate over the actor’s components it exists. But if I close and save the level and reopen it, the component added never saved.

AddComponent Blueprint:

TestComponent Blueprint:

Result after using both functions as Scripted Actions:

LogBlueprintUserMessages: [None] Component GeometryDataComponent_0 added to actor Actor_5
LogBlueprintUserMessages: [None] Component GeometryDataComponent_0 exists in actor Actor_5

I also tried connecting the actor to the “World Context Object”, and also connected the GetEditorWorld. But nothing works.

Any idea?

If you made your actor component in the editor that did not work for me either… if you add component to any actor in a level and make a blueprint or C++ script component off of it that runs through setting up a new class that inherits from Actor Component

wasn’t able to find a different in editor option to make a blueprint script component so there’s probably another way, if you find it would love to know, but that should work for ya

344220-editorcomp.png

Hello there, just wondering if you ever found out how to get this working, as
I’m currently facing the same issue.

I found a solution but it only works in Unreal 5.0+

Add a component with Blueprint script in the editor

This works in 5.3

Editor Utility for adding an Actor Component to an Actor posted by PDubulous | blueprintUE | PasteBin For Unreal Engine