# How to use SetTimelineFinishedFunc in UE4.25

**URL:** <https://forums.unrealengine.com/t/how-to-use-settimelinefinishedfunc-in-ue4-25/474193>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [November 9, 2020, 6:43am UTC](https://forums.unrealengine.com/t/how-to-use-settimelinefinishedfunc-in-ue4-25/474193 "2020-11-09T06:43:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![OrangesDay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OrangesDay](https://forums.unrealengine.com/u/OrangesDay)\
**Post date:** [November 9, 2020, 6:43am UTC](https://forums.unrealengine.com/t/how-to-use-settimelinefinishedfunc-in-ue4-25/474193/1 "2020-11-09T06:43:03Z")

</div>

When I use SetTimelineFinishedFunc in UE4.25 will Error(error c2664),  
how to make it?

 ![321505-20201109142821.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/8/3/98396a3160c07b2331063fdf96565c67f1a93dde.png)

---

<div class="post-metadata">

**Author:** ![OrangesDay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OrangesDay](https://forums.unrealengine.com/u/OrangesDay)\
**Post date:** [November 10, 2020, 5:44am UTC](https://forums.unrealengine.com/t/how-to-use-settimelinefinishedfunc-in-ue4-25/474193/2 "2020-11-10T05:44:42Z")

</div>

Interactable\_Door.cpp

#include “Kismet/KismetMathLibrary.h”  
#include “Interactable\_Door.h”

void AInteractable\_Door::BeginPlay()  
{  
Super::BeginPlay();

```
if (CurveFloat)
{
	DoorTimeline->AddInterpFloat(CurveFloat, InterpFunction, FName("Alpha"));
	DoorTimeline->SetTimelineFinishedFunc(TimelineFinish);
	DoorTimeline->SetLooping(false);
}

```

}

AInteractable\_Door::AInteractable\_Door()  
{  
DoorTimeline = CreateDefaultSubobject(“Timeline”);  
InterpFunction.BindUFunction(this, FName(“InterpReturn”));  
TimelineFinish.BindUFunction(this, FName(“OnFinish”));  
}

void AInteractable\_Door::Interact()  
{  
if (Closed)  
{  
DoorTimeline-\>Play();  
}  
else  
{  
DoorTimeline-\>Reverse();  
}  
Closed = !Closed;  
}

void AInteractable\_Door::OnFinish()  
{

}

void AInteractable\_Door::InterpReturn(float value)  
{  
Mesh-\>SetRelativeRotation(FRotator(0, UKismetMathLibrary::Ease(0, -110, value, EEasingFunc::SinusoidalInOut), 0));  
}

---

<div class="post-metadata">

**Author:** ![OrangesDay](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@OrangesDay](https://forums.unrealengine.com/u/OrangesDay)\
**Post date:** [November 10, 2020, 5:47am UTC](https://forums.unrealengine.com/t/how-to-use-settimelinefinishedfunc-in-ue4-25/474193/3 "2020-11-10T05:47:47Z")

</div>

Interactable\_Door.h

#pragma once

#include “CoreMinimal.h”  
#include “…/Interactable/Master\_Interactable.h”  
#include “Components/TimelineComponent.h”  
#include “Interactable\_Door.generated.h”

/\*\*  
\*  
\*/  
UCLASS()  
class THEIRSTORY\_API AInteractable\_Door : public AMaster\_Interactable  
{  
GENERATED\_BODY()

protected:  
virtual void BeginPlay() override;

private:  
bool Closed;

public:  
AInteractable\_Door();

```
virtual void Interact() override;

UFUNCTION()
void OnFinish();

UFUNCTION()
void InterpReturn(float value);

FOnTimelineFloat InterpFunction{};
FOnTimelineFloat TimelineFinish{};

UPROPERTY()
UTimelineComponent* DoorTimeline;

UPROPERTY()
UCurveFloat* CurveFloat;

```

};
