How to Disable Chaos in UE4 26 (WITH_CHAOS Macro)

Hi,

I am migrating from 4.24 to 4.26.0.

I am using NVIDIA Physics handle at some point and that handle is disabled by default in the engine.

in 4.24 WITH_CHAOS is 0 by default

in 4.26 WITH_CHAOS is 1 by default

You can double check that from the following header file.

Physics/PhysicsInterfacePhysX.h

I would like to disable Chaos Physics.

PxRigidBody* rigid_body_handle = FPhysicsInterface_PhysX::GetPxRigidBody_AssumesLocked(BodyInstance->GetPhysicsActorHandle());

Two things I tried,

  1. Adding

    PublicDefinitions.Add(“WITH_CHAOS=0”);

to build.cs

  1. Adding

    bUseChaos = false;

to Editor.target.cs

I was going to say:

If you search for WITH_CHAOS in .cs files, you’ll see it’s defined in ModuleRules.cs. It’s controlled with whether or not Target.bUseChaos is set somewhere.
Searching for bUseChaos in .cs files, I find it’s set false by default in TargetRules.cs. So I’m not sure where it’d be getting set to false unless you’re using the precompiled editor and they have it set to true.

But you already know about bUseChaos.

Are you compiling the engine yourself or using a precompiled editor? bUseChaos should be all you need, but if you’re using a prebuilt editor I’m not sure how that would work out.

1 Like