# How can I use timeline in blueprint with C++

**URL:** <https://forums.unrealengine.com/t/how-can-i-use-timeline-in-blueprint-with-c/295254>\
**Category:** Blueprint\
**Tags:** how-to, unreal-engine, CPP, question\
**Created:** [October 4, 2014, 2:48pm UTC](https://forums.unrealengine.com/t/how-can-i-use-timeline-in-blueprint-with-c/295254 "2014-10-04T14:48:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_ae83a99d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ae83a99d](https://forums.unrealengine.com/u/anonymous_user_ae83a99d)\
**Post date:** [October 4, 2014, 2:48pm UTC](https://forums.unrealengine.com/t/how-can-i-use-timeline-in-blueprint-with-c/295254/1 "2014-10-04T14:48:47Z")

</div>

I want to use timeline in blueprint with C++.

But, I can’t understand how to use it.

What is FOnTimelineFloat, in middle of the AddInterpFloat function’s parameters?

I was trying to type name of custom function like below in middle of the params, but compiler occurred an error.

`void AHeaderFileName::CustomFunction(float Output) { //Do Stuff }`

---

<div class="post-metadata">

**Author:** ![Atheist91](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Atheist91](https://forums.unrealengine.com/u/Atheist91)\
**Post date:** [October 10, 2014, 9:34pm UTC](https://forums.unrealengine.com/t/how-can-i-use-timeline-in-blueprint-with-c/295254/2 "2014-10-10T21:34:14Z")

</div>

I don’t know how to use it either. Could anyone help with this?

---

<div class="post-metadata">

**Author:** ![domzorg](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/domzorg/32/906605_2.png) [@domzorg](https://forums.unrealengine.com/u/domzorg)\
**Post date:** [May 15, 2015, 9:19am UTC](https://forums.unrealengine.com/t/how-can-i-use-timeline-in-blueprint-with-c/295254/3 "2015-05-15T09:19:58Z")

</div>

Hello,

This function parameter must be set to your call-back function (CustomFunction).

What you need to do is having a member var of type FOnTimelineFloat.

Ie. in your header class.

```
class XXXX {  

private:
    UFUNCTION()
    void AHeaderFileName::CustomFunction(float Output);  

private:
    FOnTimelineFloat CallBackFunction;  
    FTimeline	TheTimeline;
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Curves")
UCurveFloat* TheCurve;
};

```

In the cpp file, where you have initialization. Ie. in PostInitializeComponents()

```
void XXXXX::PostInitializeComponents()
{
	Super::PostInitializeComponents();

	if (TheCurve)
	{
		TheTimeline = FTimeline();
		CallBackFunction.BindUFunction(this, "CustomFunction");
		TheTimeline.AddInterpFloat(TheCurve, CallBackFunction);
	}

```

I hope it will help.  
Dominique
