Skip to content

Debug Variable

Display a variable on a PlayMaker debug panel while the current state is active.

This is a lightweight way to watch changing values in the Game View without filling the Unity Console with logs every frame.

What It Does

Debug Variable extends BaseDebugAction and updates a label every frame.

It reads the selected variable through AnyVariableRef, formats the value using PlayMaker's debug formatting helpers, and shows either:

  • your custom label, or
  • the variable's short name

followed by the current value.

Parameters

Parameter Description
Variable The variable to display.
Label Optional text shown before the value. Leave it empty to use the variable name.
Debug Display Controls where the debug panel is shown.

Example

Use this action to watch a health value during combat:

  1. Add Debug Variable to the state that updates or monitors health.
  2. Set Variable to your Health variable.
  3. Optionally set Label to HP.
  4. Enter Play Mode and watch the displayed value update while the state is active.

Notes

  • This action only displays while the state is active.
  • It uses PlayMaker's stable debug string formatting, which is often clearer than a raw ToString() result.
  • For console logging instead, use Debug Log Variable from the Action Browser.