RE: UE-81677 UnrealMathTest fails when compiled with VS2019
I am using Visual Studio 2019 Pro (v.16.3.5) and am experiencing this error as well. From my research, it appears that that this happens with the C++ code optimizer when it tries to do a fast normalize – it uses an uninitialized register. This appears to be a compiler level bug.
Effect: Vectors, rotators, and any math which depends on square roots (ie, normalization) will be quite off and you’ll get glitchy behavior (objects appearing/disappearing at random, wrong textures, other rendering artifacts).
Best Practice: Avoid updating to the latest version of Visual Studio 2019 until Microsoft issues a compiler hotfix (No ETA).
Workaround: If you already updated visual studio 2019, the work around is to use the visual studio installer to install the 14.22.27905 build tool chain and then modify the UE4 “\Engine\Saved\UnrealBuildTool\BuildConfiguration.xml” to point to that compiler version. I have verified that this works.
References: