Download

C++ Timeline Reverse() not working

Hi,
I am trying to create a Timeline Component in C++ for some reason the Reverse method is not working as intended the Cube just never return back.

Constructor:



    MyTimeline = CreateDefaultSubobject<UTimelineComponent>(TEXT("MyTimeline"));

    TimelineDelegate.BindUFunction(this, FName("TimelineCallback"));
    TimelineEventDelegate.BindUFunction(this, FName("TimelineFinished"));



Begin Play



if (FloatCurve)
    {
        MyTimeline->AddInterpFloat(FloatCurve, TimelineDelegate,FName("Alpha"));
        MyTimeline->SetTimelineFinishedFunc(TimelineEventDelegate);
        MyTimeline->SetLooping(false);

        MyTimeline->Play();
    }


TimelineCallBack Function



        AddActorLocalOffset(FVector(0, 0, 2.5f));


Timeline Finished Function



    if (MyTimeline->GetPlaybackPosition() == 0.0f)
    {
        MyTimeline->Play();
    }
    else if(MyTimeline->GetPlaybackPosition() == MyTimeline->GetTimelineLength())
    {
        UE_LOG(LogTemp, Warning, TEXT("Reverse"));
        MyTimeline->Reverse();
    }