I can not add Components to actor using code

Use CreateDefaultSubobject only in the constructor

Mesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("Write here the component name"));