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:
.h:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Explosion")
UStaticMeshComponent* meshComponent;
.cpp:
MyActorSubclass::MyActorSubclass(){
//...
meshComponent = CreateDefaultSubobject<UStaticMeshComponent>("meshComponent");
meshComponent->AttachTo(contactSphere);
}
Why are the materials not accessible for the component created in C++?