RealDocs

UKismetMathLibrary::CInterpTo

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

Description

Interpolates a linear color from Current toward Target each frame using exponential ease-out, producing a fast initial movement that slows as it approaches the target. Call this every tick and store the result back into the Current variable.

Caveats & Gotchas

  • Unlike a fixed lerp, the result is frame-rate dependent unless you pass the actual per-frame DeltaTime — do not cache or batch-call with a fixed timestep.
  • Passing InterpSpeed = 0 causes an immediate snap to Target regardless of DeltaTime.
  • Interpolation happens per channel independently in linear RGB space; large hue shifts can pass through desaturated greys. Use LinearColorLerpUsingHSV for hue-aware blending.

Signature

static UE_INL_API FLinearColor CInterpTo(FLinearColor Current, FLinearColor Target, float DeltaTime, float InterpSpeed);

Parameters

Name Type Description Default
Current FLinearColor Current color value this frame.
Target FLinearColor Target color to move toward.
DeltaTime float Time elapsed since the last call, typically from Tick's DeltaSeconds.
InterpSpeed float Rate of interpolation. Higher values snap faster. Pass 0 to jump immediately to Target.

Return Type

FLinearColor

Example

Smoothly tint a dynamic light each tick C++
// In AMyActor::Tick
CurrentLightColor = UKismetMathLibrary::CInterpTo(
    CurrentLightColor,
    TargetLightColor,
    DeltaTime,
    5.f
);
PointLight->SetLightColor(CurrentLightColor);

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.