Changing the actor that owns a component

For some background, in the system I am working on, I am using many different components that are created at runtime to make up an actor. That actor can then be broken into pieces, upon which a different actor is created and the appropriate components are unattached from the original actor and attached to the new one.

It’s a system I’ve been messing around with for a while, and it works on its own. The problem is, I’ve had to jump through many hoops with the fact that the new actor technically isn’t the “owner” of the components, just the attachparent. This has become a big problem while I’ve been trying to work on network replication, and frankly it’s far too much of a hassle than it should be.

So I’m here to ask; is there ANY way, using Blueprints or C++ or otherwise, to change the actor that owns a component during runtime? Not changing the attach parent, that doesn’t do it, and not destroying the components and adding them again, that is too much additional strain and hassle.

If there isn’t a way, I’m here to request a “change component owner” function for the engine. It would be extremely helpful for my game and I’m sure many others as well.

+1 - Any way to change component’s owner?

Call UObject::Rename() and pass the new Outer as a parameter. If you pass null as the new name it will keep the old name.

Franco

I also encountered this problem, hope someone can solve it