UAnimInstance::DisplayDebug
#include "Animation/AnimInstance.h"
Access: public
Specifiers: virtualENGINE_API
Description
Draws animation debug information onto the HUD canvas when the 'Animation' debug category is active via the `showdebug Animation` console command. Override this to add custom debug visualisation for your anim instance.
Caveats & Gotchas
- • Only called in non-shipping builds. Do not place gameplay logic in this function — it will be stripped in shipping.
- • Call Super::DisplayDebug() first and advance YPos by YL after each line you draw to avoid overlapping the base class output.
Signature
virtual void DisplayDebug(UCanvas* Canvas, const FDebugDisplayInfo& DebugDisplay, float& YL, float& YPos) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| Canvas | UCanvas* | The canvas to draw debug information onto. | — |
| DebugDisplay | const FDebugDisplayInfo& | Describes which debug categories are currently active. | — |
| YL | float& | Height of the last drawn line, used to advance the draw position. | — |
| YPos | float& | Current vertical draw position on the canvas. | — |
Return Type
void Example
Add custom debug output to the animation HUD C++
void UMyAnimInstance::DisplayDebug(UCanvas* Canvas, const FDebugDisplayInfo& DebugDisplay, float& YL, float& YPos)
{
Super::DisplayDebug(Canvas, DebugDisplay, YL, YPos);
FDisplayDebugManager& DisplayManager = Canvas->DisplayDebugManager;
DisplayManager.DrawString(FString::Printf(TEXT("Speed: %.1f"), GroundSpeed));
YPos += YL;
} Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?