Announcement

Collapse
No announcement yet.

C++ Timeline Reverse() not working

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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:
    Code:
        MyTimeline = CreateDefaultSubobject<UTimelineComponent>(TEXT("MyTimeline"));
    
        TimelineDelegate.BindUFunction(this, FName("TimelineCallback"));
        TimelineEventDelegate.BindUFunction(this, FName("TimelineFinished"));
    Begin Play
    Code:
    if (FloatCurve)
        {
            MyTimeline->AddInterpFloat(FloatCurve, TimelineDelegate,FName("Alpha"));
            MyTimeline->SetTimelineFinishedFunc(TimelineEventDelegate);
            MyTimeline->SetLooping(false);
    
            MyTimeline->Play();
        }
    TimelineCallBack Function
    Code:
            AddActorLocalOffset(FVector(0, 0, 2.5f));
    Timeline Finished Function
    Code:
        if (MyTimeline->GetPlaybackPosition() == 0.0f)
        {
            MyTimeline->Play();
        }
        else if(MyTimeline->GetPlaybackPosition() == MyTimeline->GetTimelineLength())
        {
            UE_LOG(LogTemp, Warning, TEXT("Reverse"));
            MyTimeline->Reverse();
        }
Working...
X