A MaterialInstanceDynamic created in the construction script has an empty scalar parameter array, even if it definitely has scalar parameters present.
Here is a test actor demonstrating the issue (4.15.1) - just drop it into a map and note the editor log output.
- First it prints out the ScalarParameterValues array from the source material instance (“Value” and “RefractionDepthBias”).
- Then it creates a MID and attempts to print the ScalarParameterValues array in the same way, but it is empty.
- After that, it prints out the length of the MID scalar parameter array (0), and then gets the “Value” parameter using the “GetScalarParameterValue” node, and it returns the correct value (0.5), to show that the parameter is definitely present in the MID, but not in the array.
The array in the MID is filled correctly at BeginPlay, so I’m guessing it’s filled after the construction script runs. I’m guessing this could be by design, for optimisation or something, but if it doesn’t do any harm it’d be useful to have that array reflect the parameters as soon as the MID is created.