RealDocs

UKismetMathLibrary::MakePulsatingValue

function Engine Blueprint Since 4.0
#include "Kismet/KismetMathLibrary.h"
Access: public Specifiers: staticBlueprintPureUFUNCTION

Description

Returns a scalar in [0, 1] that oscillates sinusoidally at the given frequency. Useful for pulsating UI effects, breathing lights, or any repeating visual driven by game time.

Caveats & Gotchas

  • The output is a half-rectified sine wave scaled to [0, 1] — it never goes negative. If you need a full [-1, 1] oscillation, use FMath::Sin(InCurrentTime * InPulsesPerSecond * 2.0f * PI) directly.
  • InCurrentTime expects absolute world time, not delta time. A timer that resets at a boundary will cause a visible pop in the output value at each reset.

Signature

static ENGINE_API float MakePulsatingValue(float InCurrentTime, float InPulsesPerSecond = 1.0f, float InPhase = 0.0f);

Parameters

Name Type Description Default
InCurrentTime float Current absolute time (e.g. GetWorld()->GetTimeSeconds()).
InPulsesPerSecond float Number of full oscillation cycles per second. 1.0f
InPhase float Phase offset in [0, 1] to shift the cycle start. 0.0f

Return Type

float

Example

Pulse a widget opacity to draw the player's attention C++
float Opacity = UKismetMathLibrary::MakePulsatingValue(
    GetWorld()->GetTimeSeconds(),
    2.0f,
    0.0f
);
MyWidget->SetRenderOpacity(Opacity);

Tags

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.