How to get TimelineComponent direction?

The timeline automatically sets the direction property on a provided object given the following:

Timeline.SetPropertySetObject(UObject); // Object to set the property on
Timeline.SetDirectionPropertyName(FName); // Name of the UPROPERTY

So a final setup would look somethnig like this:
MyActor.h

FTimeline Timeline;

UPROPERTY()
TEnumAsByte<ETimelineDirection::Type> TimelineDirection;

MyActor.cpp

Timeline.SetPropertySetObject(this);
Timeline.SetDirectionPropertyName(FName("TimelineDirection"));

Then you can use the following variable and it will tell you the direction

TimelineDirection == ETimelineDirection::Forward

or

TimelineDirection == ETimelineDirection::Backward

good luck

2 Likes