Can Static Meshes Components be Added Outside of the Constuctor?

I’ve been trying to figure out how to create a different static mesh for an actor depending on conditions it’s spawned in.

When I try to add a new static mesh to the Actor in a function that isn’t the constructor, the Engine crashes when the function is called.

Example of the function is below:

void AActor::BuildLeft(UStaticMeshComponent* Left) {

    DummyRoot = CreateDefaultSubobject<USceneComponent>(TEXT("Dummy0"));
    RootComponent = DummyRoot;
    static FConstructorStatics ConstructorStatics;
    Left->SetRelativeLocation(FVector(0.f, -75.f, 0.f));
    LeftMesh->SetStaticMesh(ConstructorStatics.LineMesh.Get());
    Left->SetRelativeRotation(FRotator(0.f, 0.f, 0.f));
    Left->SetupAttachment(DummyRoot);
}

This is a second version of the function with me trying to pass a static mesh declared in the constructor, declaring the static mesh in the function and passing nothing also didn’t work.

Yes, you can check this topic

I’ve changed to how that topic is calling for it to be done, the issue seems to be with the line:
LeftMesh->SetStaticMesh(ConstructorStatics.LineMesh.Get());
Calling that outside of the construction script seems to immediately crash the program.
I can create a new static mesh and give it properties, but I can’t seem to give it an actual mesh.

This ConstructorStatics struct is only created the first time the constructor is run. Probably after that it’s going to nullptr.