Turning off PhysX

Hi! I’m trying to figure out how to compile without PhysX.

In my game’s Target.cs, I’ve set bCompilePhysX and bCompileAPEX to false. However, when I try to build, I get the error:

ERROR: Unable to instantiate module 'Engine': APEX is enabled, without PhysX. This is not supported!

This appears to trigger when bCompilePhysX is false but bCompileAPEX is true. From logging, it appears after my project’s Target is successfully setting bCompileAPEX to false, but by the time my game’s module is instantiated, the Target rules that are passed in have bCompileAPEX set to true.

I can’t seem to figure out what’s setting the flag back to true. Any ideas?

Well, that didn’t take long. In UEBuildLinux.cs, the ValidateTarget() function overrides it. Don’t know why I didn’t find that in my search results.

The comment indicates the code is meant to turn off APEX/NvCloth for non-x86_64 builds, but the way it’s written has the side effect of forcing them on for x86_64 builds.

Probably should ‘&&’ the assignment with the existing value to prevent forcing it on. :wink: