How to copy all properties of a component?

Hello.

The actor has 1 UStaticMeshComponent component.
In Runtime or in the editor (OnConstruction), I create an additional component:

UStaticMeshComponent* comp = NewObject<UStaticMeshComponent>(this); 
comp->AttachToComponent(Root, FAttachmentTransformRules::KeepRelativeTransform);
comp->RegisterComponent();

How to clone all the properties of a component to a second component (Static Mesh, Materials, settings in the Render Tab)?

UPD:
problem solved: DuplicateObject
UStaticMeshComponent * comp2 = DuplicateObject <UStaticMeshComponent> (comp, this);

2 Likes