UStaticMeshComponent materials not editable in blueprint when instantiated from C++

I have an AActor subclass with a static mesh component added in C++, and I can’t set the material property in a blueprint derived subclass.

Here’s what the details panel looks like for a mesh component added directly from blueprint:

And here’s what I see for my component added in C++:

As you can see, the “Materials” tab is completely missing.

Here’s how I declare and instantiate the mesh component:


UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Explosion")
UStaticMeshComponent* meshComponent;


    meshComponent = CreateDefaultSubobject<UStaticMeshComponent>("meshComponent");

Why are the materials not accessible for the component created in C++?

You can open the Rendering tab and override the materials there.