Lumberyard
User Guide (Version 1.21)

Debugging PhysX

The PhysX system has the following features that you can use to debug issues.

Note

You must first enable the PhysX Debug gem.

PhysX Debug Console Variables

Enter the following console variables to debug your PhysX issues.

Sets your preferences for debugging. As a recommended best practice, enter this console variable command as your first step for debugging.

physx_Debug 1

You can specify the following values:

  • 1 – Enable debug visualizations. By default, this value enables the collision shapes and edges for your PhysX entities.

  • 2 – Enables all configuration options. This enables all the available visualization options.

  • 3 – Toggles the proximity based collider visualization. This value applies only to mesh colliders. See Creating Mesh Colliders.

  • 0 – Disables debug visualizations.

Toggles a visual culling box frame.

physx_CullingBox 1

Adjusts the culling box size to 100. Enter 0 to disable culling.

physx_CullingBoxSize 100

Connects to the PhysX Visual Debugger. You must have the PhysX Visual Debugger open to run this command. See Debugger Configuration.

physx_PvdConnect

Disconnects from the PhysX Visual Debugger. You must have the PhysX Visual Debugger open to run this command. See Debugger Configuration.

physx_PvdDisconnect

For more information, see Using the Console Window.

Debugging with the ImGui Tool

In game mode, you can configure the PhysX debug settings using the immediate mode graphical user interface (ImGui) tool.

Note

You must enable the ImGui gem to access this tool. For more information, see Enabling Gems.

To debug with the ImGui tool

  1. Press Ctrl+G to enter gameplay mode.

  2. Press the Home key to open the ImGui tool. The PhysX Debug menu appears under the Perspective viewport.

  3. Click PhysX Debug.

    Example

    
                            PhysX Debug menu in gameplay mode.
  4. You can make the following changes.

    PhysX Debug Settings Description

    Debug visualizations

    Enables debug visualizations mode.

    This is the same as the physx_Debug 1 console variable.

    Visualize Colliders

    Enables colliders to appear.

    This is the same as the physx_Debug 3 console variable.

    Culling

    You can specify the following options:

    • Wireframe – Displays wireframes in the viewport.

    • Size – Click and drag the slider to specify the size of the wireframes. As a best practice, keep this value small to prevent performance issues.

    Collisions

    Enables debugging for collision types. You can specify the following options:

    • Shapes

    • Edges

    • F Normals

    • Aabbs

    • Axis

    • Compounds

    • Static

    • Dynamic

    Body

    Enables debugging for body types. You can specify the following options:

    • Axes

    • Mass Axes

    • Linear Velocity

    • Angular Velocity

    Contact

    Enables debugging for contact types. You can specify the following options:

    • Point

    • Normal

    Character

    Enables debugging for characters. You can specify the following options:

    • Joint Limits

    • Mbp Regions

    • Actor Axes

    PhysX Color Mappings

    Specifies your preferred color mappings.

    Enable/Disable all settings

    Enables or disables all debug settings.

    This is the same as the physx_Debug 3 or 0 console variable.

    PhysX Scale

    Click and drag the slider to adjust the scale of the debug.

Debug Options in the PhysX Configuration

You can also specify debug settings in the PhysX Configuration tool. See Debugger Configuration.