Hello guys,
I’m using 4.9.1 version and i have a problem with that…
I have two project one of them created before in two or three month ago.
In older one these lines of codes work perfect and I can get “Playing” in my log. but in newer project it doesn’t work and always false just one tick is true!!
in . h file
UPROPERTY(VisibleDefaultsOnly, BlueprintReadOnly)
UTimelineComponent* MyTimeline;
in .cpp file
MyActor::MyActor()
{
MyTimeline = CreateDefaultSubobject<UTimelineComponent>(TEXT("MyTimeline"));
MyTimeline->SetTimelineLength(2.f);
MyTimeline->SetPlayRate(1.f);
MyTimeline->Activate(false);
}
void MyActor::BeginPlay()
{
Super::BeginPlay();
MyTimeline->PlayFromStart();
}
void MyActor::Tick( float DeltaTime )
{
Super::Tick( DeltaTime );
if (MyTimeline->IsPlaying())
UE_LOG(LogTemp, Warning, TEXT("Playing"));;
}