Changing cube color

Hello,

I’m trying to do some really simple stuff - changing the color of a cube - … with no success, shame on me!!!
I don’t get it, here is my code :



UStaticMeshComponent *mesh = myActorComponent->GetOwner()->FindComponentByClass<UStaticMeshComponent>();
mesh->SetMobility(EComponentMobility::Movable);
UMaterialInstanceDynamic *material = mesh->CreateDynamicMaterialInstance(0, m_cellMaterialPrefab); // cellMaterialPrefab is a correctly retrieved Material in Content/Materials folder.
mesh->SetMaterial(0, material);
material->SetVectorParameterValue("BaseColor", FLinearColor::Red);


What’s wrong with my code?
Thanks.