# Link to timelines doc for c++?

**URL:** <https://forums.unrealengine.com/t/link-to-timelines-doc-for-c/349439>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [March 3, 2016, 7:13pm UTC](https://forums.unrealengine.com/t/link-to-timelines-doc-for-c/349439 "2016-03-03T19:13:31Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![spaceharry](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@spaceharry](https://forums.unrealengine.com/u/spaceharry)\
**Post date:** [April 5, 2016, 9:33pm UTC](https://forums.unrealengine.com/t/link-to-timelines-doc-for-c/349439/7 "2016-04-05T21:33:59Z")

</div>

After trying this before I thought I give this timeline in c++ another shot. There are still some old answers here on answerhub which show how to use timelines in c++ with the actor’s own tick function. But actually it also works withouth using the tick of the actor. I had to use AddInterpFloat() at runtime to get this to run.

This answer should work for you!

//.h

```
UPROPERTY()
UTimelineComponent* ScoreTimeline;

UPROPERTY()
UCurveFloat* fCurve;

FOnTimelineFloat InterpFunction{};

```

//.cpp

//Constructor:

```
static ConstructorHelpers::FObjectFinder<UCurveFloat> Curvy(TEXT("CurveFloat'/Game/Blueprints/NotSoImportant/CurveFloatBP.CurveFloatBP'"));
if (Curvy.Object) {
	fCurve = Curvy.Object;
}

ScoreTimeline = ObjectInitializer.CreateDefaultSubobject<UTimelineComponent>(this, TEXT("TimelineScore"));

InterpFunction.BindUFunction(this, FName{ TEXT("TimelineFloatReturn") });

```

//Then inside BeginPlay for example:

```
ScoreTimeline->AddInterpFloat(fCurve, InterpFunction, FName{ TEXT("Floaty") });
ScoreTimeline->Play(); // or PlayFromStart() etc, can be called anywhere in this class

```

//And Finally your callback function:

```
void AYourClass::TimelineFloatReturn(float val)
{
 //Your float val from curve returns here
}

```

}

I made a wiki page about this here:

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

---

_[View the full topic](https://forums.unrealengine.com/t/link-to-timelines-doc-for-c/349439)._
