Unreal 5.4 HSL variable length arrays are not supported in HLSL error

Hello!

I am trying to build standard Metahumans and other standard assets in Unreal Engine 5.4 for Windows, and I am constantly getting the next error during the header material build.

But in Editor, whatever option to launch a game I use - all works well for example hair has physics in Metahumans, but when I build a game - hair stops working, it stops moving

How to fix that?

UATHelper: Packaging (Windows): LogShaderCompilers: Warning: Failed to compile Material /Game/MetaHumans/Common/Face/Materials/M_lacrimal_fluid.M_lacrimal_fluid for platform PCD3D_SM6, Default Material will be used in game.
UATHelper: Packaging (Windows):   /Engine/Private/CapsuleLightIntegrate.ush:146:19: error: variable length arrays are not supported in HLSL
UATHelper: Packaging (Windows):              uint NumSamples[ NumSets ] =
UATHelper: Packaging (Windows):                             ^
UATHelper: Packaging (Windows):   /Engine/Private/RectLightIntegrate.ush:286:19: error: variable length arrays are not supported in HLSL
UATHelper: Packaging (Windows):              uint NumSamples[ NumSets ] =
UATHelper: Packaging (Windows):                             ^
PackagingResults: Warning: Failed to compile Material /Game/MetaHumans/Common/Face/Materials/M_lacrimal_fluid.M_lacrimal_fluid for platform PCD3D_SM6, Default Material will be used in game.
PackagingResults: Error: variable length arrays are not supported in HLSL
PackagingResults: Error: variable length arrays are not supported in HLSL

UATHelper: Packaging (Windows): LogShaderCompilers: Warning: Failed to compile Material /Game/MSPresets/M_MS_Glass_Material/M_MS_Glass_Material.M_MS_Glass_Material for platform PCD3D_SM6, Default Material will be used in game.
UATHelper: Packaging (Windows):   /Engine/Private/CapsuleLightIntegrate.ush:146:19: error: variable length arrays are not supported in HLSL
UATHelper: Packaging (Windows):              uint NumSamples[ NumSets ] =
UATHelper: Packaging (Windows):                             ^
UATHelper: Packaging (Windows):   /Engine/Private/RectLightIntegrate.ush:286:19: error: variable length arrays are not supported in HLSL
UATHelper: Packaging (Windows):              uint NumSamples[ NumSets ] =
1 Like

I have exactly the same error and I can’t even begin to figure out what the problem could be and how to solve it. I can’t find anything on the internet about this issue except for your post here.

Have you managed to find or avoid this problem? If so, what did you do about it?

PS: Actually, I get it not during assembly, but when saving the material taken from CitySample (there is no problem during compilation, but when I try to save the material, it appears). And I have UE 5.3 version