Make root component replaceable

I have a custom class in c++ with Pawn as parent. I need to make a root component replaceable via blueprints. Is there a way to do this?

with AActor::SetRootComponent you can change the RootComponent on runtime. It wasn’t exposed to Blueprints in the last couple of versions, not sure if it is now. If it isn’t exposed, just write a BlueprintCallable function and call SetRootComponent there.

There is no way (that I know of) that let’s you change inherited components via the Blueprint editor.

Hello, did you find a solution?

thanks, this should be exposed to blueprint !

I exposed it to blueprint but it does not work. It hangs in unreal 5.3.

You can absolutely do it in Blueprint by exposing the AA::SetRootComponent()
BUT when you create a component in bp using “AddComponentByClass” you have to make sure your set the manual attachment to true or else it will crash the whole editor