RealDocs

UCurveFloat

class Engine Blueprint Since 4.0
#include "Curves/CurveFloat.h"

Description

A curve asset that maps time (float) to a float value via keyframed spline data. Use GetFloatValue(t) to sample at runtime — common for easing, damage falloff, speed curves, and any time-driven scalar.

Signature

class UCurveFloat : public UCurveBase

Caveats & Gotchas

  • GetFloatValue extrapolates beyond the curve range based on the curve's extrapolation settings. Check editor curve extrapolation if you get unexpected values outside your keyframe range.
  • The curve is read-only at runtime by default. Modifying keyframes at runtime is possible but uncommon and may not replicate.
  • For in-struct (non-asset) curves, use FRuntimeFloatCurve and access it via GetRichCurve() — this supports both external curve assets and embedded keyframes.

Example

Sample a damage falloff curve C++
UPROPERTY(EditDefaultsOnly)
UCurveFloat* DamageFalloffCurve;

float GetDamageAtDistance(float Distance) const
{
    if (DamageFalloffCurve)
    {
        return BaseDamage * DamageFalloffCurve->GetFloatValue(Distance);
    }
    return BaseDamage;
}

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.