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 }
Atheist91
(Atheist91)
2
I don’t know how to use it either. Could anyone help with this?
domzorg
(domzorg)
3
Hello,
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 {
private:
UFUNCTION()
void AHeaderFileName::CustomFunction(float Output);
private:
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()
{
Super::PostInitializeComponents();
if (TheCurve)
{
TheTimeline = FTimeline();
CallBackFunction.BindUFunction(this, "CustomFunction");
TheTimeline.AddInterpFloat(TheCurve, CallBackFunction);
}
I hope it will help.
Dominique