How can I make the root component of an actor overridable?

I’m working on an actor that has very specific code that relies on a particular component, but doesn’t, at it’s base, require anything else. (It’s a USceneCaptureComponent2D, and some render target code). Because the Scene Capture Component is the only component I implement in c++, it’s by default the root, and I can’t override that in Blueprint. Is there a way to make it so I can override it in Blueprint so I can, say, parent it to a static mesh?

Use an empty component (USceneComponent) as a root and attach your whole object hierarchy to it.
(In your case - the capture component) …If you need your component not being the root.

Edit: You need a wrapper component to encapsulate the logic you need to override as I don’t think there is a way to override inherited components in blueprint.

Can you go into more detail about what actual code you need? I’m not doing any code overriding, just replacing the root component.

And this didn’t work:

UPROPERTY(EditAnywhere, Category = "Compoents")
		USceneCaptureComponent2D* SceneCaptureComp;

and

DefaultRoot = CreateDefaultSubobject<USceneCaptureComponent>("DefaultRootComponent");
	RootComponent = DefaultRoot;

	SceneCaptureComp = CreateDefaultSubobject<USceneCaptureComponent2D>(TEXT("SceneCaptureComponent"));
	SceneCaptureComp->bCaptureEveryFrame = false;
	SceneCaptureComp->bCaptureOnMovement = false;
	SceneCaptureComp->SetupAttachment(DefaultRoot);

What are you trying to achieve?

Make the component usable in blueprint for other actors?

Make the component not placed at the root of your Actor?

What are you trying to “override” as you used the word twice in the question?

The c++ code requires that a certain scene component exists, and therefore I define it in c++, but it doesn’t matter where in the component hierarchy it is, so I want the designer to be able to place it wherever he/she wants.

If your sole purpose is to make the component usable by the designers you should make a blueprint component out of your C++ component.

Right click on your C++ component in the editor and you should see the option in the context menu. (2-nd option I think)

The blueprint component would inherit all functionality from your C++ class and can be further modified depending on what was exposed in your C++ code.