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
UCLASS()
class TESTDESTRUCTION_API ASplodyMesh : public AActor
{
	GENERATED_BODY()
	
public:	
	// ---------------------------------------------------------- Unreal Actor
	ASplodyMesh();

protected:
	virtual void BeginPlay() override;

public:	
	virtual void Tick(float DeltaTime) override;

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

    // WORKS
	UPROPERTY(VisibleAnywhere)
		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
	UPROPERTY(VisibleAnywhere) 
		class UStaticMesh* TargetMesh2;
    ...



// .cpp 

ASplodyMesh::ASplodyMesh()
{
	PrimaryActorTick.bCanEverTick = true;

	RestoredMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("RestoredMesh"));
	RestoredMesh->SetupAttachment(GetRootComponent());

	TargetMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("TargetMesh"));
	TargetMesh->SetupAttachment(GetRootComponent());

	Destructible = CreateDefaultSubobject<UDestructibleComponent>(TEXT("Destructible"));
	Destructible->SetupAttachment(GetRootComponent());
}

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: https://www.udemy.com/course/unrealvr/

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.