[Question] How can I modify my USkeletalMeshComponent after I create it in C++?

So I have made a class that contains a USceneComponent, a USkeletalMeshComponent, and a UArrowComponent. The USceneComponent is my root component. The Skeletal mesh attaches to that, and the arrow component attaches to the skeletal mesh. The only problem is I can’t set the mesh in my blueprint after I have created it.


	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Gun")
	UArrowComponent* BulletSpawn;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Gun")
	USkeletalMeshComponent* Gun;

	UPROPERTY(BlueprintReadWrite, EditAnywhere, Category = "Gun")
	USceneComponent* DefaultSceneRoot;


    	DefaultSceneRoot = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("DefaultSceneRoot"));
    	RootComponent = DefaultSceneRoot;
    	Gun = ObjectInitializer.CreateDefaultSubobject<USkeletalMeshComponent>(this, TEXT("Gun"));
    	BulletSpawn = ObjectInitializer.CreateDefaultSubobject<UArrowComponent>(this, TEXT("BulletSpawn"));
    	Gun->AttachToComponent(RootComponent, FAttachmentTransformRules::KeepWorldTransform);
    	BulletSpawn->AttachToComponent(Gun, FAttachmentTransformRules::KeepWorldTransform);

This compiles fine, but when I go to change my skeletal mesh:

I apply it correctly, right? Well it doesn’t save. Every time I hit save, it just resets back to “None”. Anyone know what I’m doing wrong?

never mind. It is bugged. You have to hit the reset arrow and it picks Skeletal Mesh Component and it stops resetting once you hit compile.