VisibleAnywhere C++ StaticMeshComponent not editable in Blueprint subclass

Hi, I’ve been through several posts on this issue that suggested VisibleAnywhere and deleting cache (.vs, Binaries, Intermediate, Saved, *.sln) and regenerating the project files. I’ve [tried][1] [those][2] [things][3].

Challenge: I’d like to use a Blueprint class to configure settings for my C++ class, but I can’t set the StaticMesh’s in the Editor. This seemed to be a common pattern, but maybe there’s something new I’m missing.

// .h
class TESTDESTRUCTION_API ASplodyMesh : public AActor
	// ---------------------------------------------------------- Unreal Actor

	virtual void BeginPlay() override;

	virtual void Tick(float DeltaTime) override;

    // WORKS - can set to a DestructibleMesh asset in Blueprint
		class UDestructibleComponent* Destructible;

    // WORKS
		class UMaterialInterface* DestructibleOuterMaterial;

    // DOESNT WORK - shows "none" can't edit
	UPROPERTY(VisibleAnywhere, BlueprintReadWrite) 
		class UStaticMeshComponent* TargetMesh;

    // WORKS can set mesh but it's not a component
		class UStaticMesh* TargetMesh2;

// .cpp 

	PrimaryActorTick.bCanEverTick = true;

	RestoredMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("RestoredMesh"));

	TargetMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("TargetMesh"));

	Destructible = CreateDefaultSubobject<UDestructibleComponent>(TEXT("Destructible"));

Here’s how it looks when placed in the scene and similar in the BP editor.

I’ve spent 3 hours on this because it “worked before” but not now. My backup plan is to convert the UPROPERTYs to UStaticMesh*s so they can be saved, then create SubObject UStaticMeshComponent variables and set the meshes from the UPROPERTY’s in BeginPlay,

It seems like there is/was a better way. What am I missing?

If you want to edit properties of a instance, you should set property specifier to UPROPERTY(EditAnywhere).

That’s absolutely untrue for components proxying an asset.

UPROPERTY(VisibleAnywhere) class UStaticMeshComponent* TargetComponent;

Because it’s a pointer to a component, the pointer and component should not be edited. The component proxies somehow into the editor to ask for a mesh. More info here:

Ultimately, I deleted the Blueprint and started over. This was not a problem for me because I hadn’t done anything in the Blueprint, but that’s how I got past the issue.