How can I use timeline in blueprint with C++

I want to use timeline in blueprint with C++.

But, I can’t understand how to use it.

What is FOnTimelineFloat, in middle of the AddInterpFloat function’s parameters?

I was trying to type name of custom function like below in middle of the params, but compiler occurred an error.

void AHeaderFileName::CustomFunction(float Output) { //Do Stuff }

I don’t know how to use it either. Could anyone help with this?


This function parameter must be set to your call-back function (CustomFunction).

What you need to do is having a member var of type FOnTimelineFloat.

Ie. in your header class.

class XXXX {  

    void AHeaderFileName::CustomFunction(float Output);  

    FOnTimelineFloat CallBackFunction;  
    FTimeline	TheTimeline;
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Curves")
UCurveFloat* TheCurve;

In the cpp file, where you have initialization. Ie. in PostInitializeComponents()

void XXXXX::PostInitializeComponents()

	if (TheCurve)
		TheTimeline = FTimeline();
		CallBackFunction.BindUFunction(this, "CustomFunction");
		TheTimeline.AddInterpFloat(TheCurve, CallBackFunction);

I hope it will help.