Issue using Runtime float Curves Help needed

Im getting a issue where Runtime float curves do not work and always resort to the default value, ive checked the time input value and it is correct, i have no idea what is going on

and ive already tried fixing it through cpp by making a function like GetRuntimeFloatCurveValue still no result


are you sure you set a valid curve?

Yes mostly im using a instance editable variable in the same class as where I’m trying to get the value and it has 2 keys


They aren’t exposed to BP. Attempting to expose the functionality to BP is a trial an error process.
Have you thought about using a Curve Table instead if you want to stick to BP?

Other option is to just write the Add Sprint Input function to C++ and expose it.

1 Like

I have never heard of curve tables but i just set it up and it works as it should, thank you. :grinning_face:

Update I made the Runtime Float Curve work I just needed this

.h

UFUNCTION(BlueprintCallable, BlueprintPure, Category = "Math|Curves")
static float GetRuntimeFloatCurveValue(

const FRuntimeFloatCurve& InCurve, 
float InTime, 
float InDefaultValue = 0.0f
);

cpp

float UBPFL_Utils::GetRuntimeFloatCurveValue(const FRuntimeFloatCurve& InCurve, float InTime, float InDefaultValue)
{
    const FRichCurve* RichCurve = InCurve.GetRichCurveConst();
    return RichCurve ? RichCurve->Eval(InTime, InDefaultValue) : InDefaultValue;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.