Passing Parameters to FTimelineFloat

Hello I am trying to pass a parameter in addition to the float value in FTimelineFloat but I am unable to find a way.

void UGenericComponent::Foo()
{
    FOnTimelineFloat TimelineProgress;
	TimelineProgress.Clear();
	TimelineProgress.BindUFunction(this, FName("TimelineProgressFunction")); //try to pass more parameter here. 
	FTimeline HealthTimeline;
	FName name = "NAME";
	HealthTimeline.AddInterpFloat(CurveFloat, TimelineProgress, name);
	HealthTimeline.PlayFromStart();
}
void UGenericComponent::TimelineProgressFunction(const float& Value,const int32 & Index)
{
	UE_LOG(LogTemp, Warning, TEXT("TIMELINE CALLEEED"));
}

If I try to pass more parameters in TimelineProgress.BindUFunction(this, FName(“TimelineProgressFunction”)) line then I get Error that too many function arguments. Is it possible even to pass more arguments ?

No, it’s not possible. You must have exactly what’s specified in the delegate declaraction, in this case it’s DECLARE_DYNAMIC_DELEGATE_OneParam( FOnTimelineFloat, float, Output );

In any case, you’re getting your Index parameter elsewhere, not from the timeline. Just create another function with all the parameters you need and call it from TimelineProgressFunction() with Value as one of the parameters.

Hello I wanted to use the parameter inside the TimelineProgressFunction() . I guess there is no way :frowning: