How to Debug PhysX in Unreal Engine 4.26+

Hello, I’ve got a question about debugging PhysX code with Unreal Engine Projects. I am currently learning how collision interfaces with the game Engine using PhysX on/off. I know the Unreal will be moving away from it at some point but I still think there is value in it.

I’ve spent a while trying to figure the process out and spoken with a few other developers that are interested in how they could customize collision detection/resolution or just learn how the interface works, particularly with the PhysX Visual Debugger (PVD) (Which I got working)

I was able to generate the PhysX3.4 project files by running the RunUAT.bat however, it was tricky as I had to make some modifications to files and download a later version of CMake.

I was able to do this as follows:

  1. Download the latest version of CMake (I used 3.19.0) and replace bin and share folder under ThirdPartyNotUE/Cmake.
  2. Go to BuildPhysx.Automation.cs and remove the line [Require P4]
  3. Under Target.Compiler for BuildPhysx_Win64 change BuildPhysX_WindowsCommon to VS2019
  4. Go to Build/Source/ThirdParty/PhysX3 and run the GenerateProjects_UAT.bat this just runs RunUAT.bat with the correct command parameters.
    With the PhysX.sln you can compile it now.

The DLL files and PDB files will be saved in Engine/Binaries/ThirdParty/PhysX3/Win64/VS2019

For example, I am setting break points inside PhysicsInterfacePhysX.cpp which make calls to the PhysX Code. I find I am unable to get the debug symbols to load for PhysX3 inside visual studio. I’ve compiled Physx for Debug, and Profile and have the required files.

Now I am not sure if there are any Engine code changes or C++ modifications that are needed.

If anyone knows a work around for this it would be very much appreciated as there are others besides myself interested on this process.