Download

How do I clone all the 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 do I copy properties from the first component to the second (Static Mesh, Materials, settings in the Render Tab)?

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