Updating scalar parameter in class

I have a scalar parameter called opacity in one of my materials;

In an actor class in my game I get the reference for a static mesh that has this material, and I attempt to update this parameter in code;

		if (hitActor) //if we hit a wall, change its colour based on intensity
		{
			TArray<UStaticMeshComponent*> comps;

			hitActor->GetComponents(comps);
			for (auto StaticMeshComponent : comps)
			{

				UMaterialInstanceDynamic* miBody = StaticMeshComponent->CreateAndSetMaterialInstanceDynamic(0);
				miBody->SetScalarParameterValue("Opacity", 0.8f); //new value       
				StaticMeshComponent->SetMaterial(0, miBody);
			}
		}

However this has no effect on the displayed material, there is no change at all on my materials from running the above code, I am pretty certain I am accessing the current static mesh because if I set the static mesh to some other material at this point it changes correctly. What am I missing about these scalar parameters?

Any help is greatly appreciated, thanks!