UKismetSystemLibrary::DrawDebugFloatHistoryTransform
#include "Kismet/KismetSystemLibrary.h"
Access: public
Specifiers: staticUFUNCTIONBlueprintCallable
Description
Draws a 2D histogram graph of an FDebugFloatHistory sample buffer in the 3D world, positioned and oriented by a full transform rather than just a location.
Caveats & Gotchas
- • FloatHistory must be built up over time by repeatedly calling AddFloatHistorySample and feeding the returned struct back in — this function only draws the buffer, it does not record samples itself.
- • Unlike DrawDebugFloatHistoryLocation, which always faces the first player's camera, this variant uses a fixed DrawTransform and will not billboard toward the viewer.
- • Compiled out entirely in Shipping and Test builds since the UFUNCTION is DevelopmentOnly.
Signature
static void DrawDebugFloatHistoryTransform(const UObject* WorldContextObject, const FDebugFloatHistory& FloatHistory, const FTransform& DrawTransform, FVector2D DrawSize, FLinearColor DrawColor = FLinearColor::White, float Duration = 0.f) Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| WorldContextObject | const UObject* | World context used to resolve which world to draw in. | — |
| FloatHistory | const FDebugFloatHistory& | Sample buffer built up via AddFloatHistorySample, containing recorded values and their min/max range. | — |
| DrawTransform | const FTransform& | World transform positioning and orienting the histogram in 3D space. | — |
| DrawSize | FVector2D | Width and height of the drawn histogram. | — |
| DrawColor | FLinearColor | Color of the histogram lines. | FLinearColor::White |
| Duration | float | How long the histogram persists, in seconds. 0 draws for a single frame. | 0.f |
Return Type
void Example
Plot a value history above an actor C++
// Called each Tick, storing the running history on the actor:
SpeedHistory = UKismetSystemLibrary::AddFloatHistorySample(GetVelocity().Size(), SpeedHistory);
FTransform GraphTransform(GetActorRotation(), GetActorLocation() + FVector(0, 0, 150.f));
UKismetSystemLibrary::DrawDebugFloatHistoryTransform(
this,
SpeedHistory,
GraphTransform,
FVector2D(100.f, 50.f),
FLinearColor::Green,
0.f); See Also
Tags
Version History
Introduced in: 4.0
| Version | Status | Notes |
|---|---|---|
| 5.6 | stable | — |
Feedback
Was this helpful?