RealDocs

UKismetMathLibrary::GetRuntimeFloatCurveValue

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

Description

Evaluates an FRuntimeFloatCurve at the given time. Returns InDefaultValue if the curve has no keys or the underlying asset is null.

Caveats & Gotchas

  • FRuntimeFloatCurve can hold either a reference to an external UCurveFloat asset or inline keys. If the asset reference is valid it takes precedence over inline keys — be explicit about which mode your UPROPERTY is configured for.
  • InDefaultValue defaults to 0.0 in Blueprint. A silent zero return is indistinguishable from a valid evaluation at a time where the curve value happens to be zero, which can hide misconfigured curve assets.

Signature

static ENGINE_API float GetRuntimeFloatCurveValue(const FRuntimeFloatCurve& Curve, const float InTime, const float InDefaultValue = 0.0f);

Parameters

Name Type Description Default
Curve const FRuntimeFloatCurve& The runtime float curve to evaluate.
InTime const float The time at which to evaluate the curve.
InDefaultValue const float Fallback value if the curve cannot be evaluated. 0.0f

Return Type

float

Example

Sample a damage falloff curve at hit distance C++
// DamageFalloff is an FRuntimeFloatCurve UPROPERTY set in the editor
float DamageMultiplier = UKismetMathLibrary::GetRuntimeFloatCurveValue(
    DamageFalloff, HitDistance, 1.0f);
ApplyDamage(Target, BaseDamage * DamageMultiplier);

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.