CreateAndSetMaterialInstanceDynamicFromMaterial does not change material?

Hi All,

I am using C++ and trying to change the material of a SplineMeshComponent dynamically. The initial material that I use, has all the textures as parameters, which I intend to set at runtime. So, I create a MID from the existing material and then set the texture parameter value to the loaded texture.

I should mention that this is a plugin and all of this happens when a checkbox is checked in the editor details panel. Please advise.

Thanks,