i have a really strange bug regarding code optimization.
I’m using the FMOD Plugin and got an error about vectors not being unit vectors, so i did some debugging.
The original code is just the first line (the rest is ugly debugging code):
It should just return the forward vector as unit vector. My debugging code contains some other ways to do it.
If I have the code optimazation disabled (using OptimizeCode = CodeOptimization.Never in the build.cs) i get the following result:
Just how it should be. However, if i remove the line and leave the optimization enabled i get this:
The results become quite absurd. The only correct one is ‘Forward3a’, so the only one that does not call the function “GetSafeNormal”. I dont have any problems like this in my main game module just in this plugin. Anyone else experienced something like this?
Hi, i suspect you are using vs2019.3, it’s a known bug, microsoft team has a fix on the way, but for now i suggest you to use older compilation toolchain :
here is a copy past of the workarround :
Workarround only : Install 14.22 toolchain in vs installer and force it in UE by setting BuildConfiguration.xml
Check your exact version in folder “Microsoft Visual Studio\2019\VC\Tools\MSVC” in your visual studio install path ( see in vs installer )