# Timeline playing twice as fast in C++?

**URL:** <https://forums.unrealengine.com/t/timeline-playing-twice-as-fast-in-c/129468>\
**Category:** C++\
**Tags:** unreal-engine\
**Created:** [August 2, 2019, 1:05pm UTC](https://forums.unrealengine.com/t/timeline-playing-twice-as-fast-in-c/129468 "2019-08-02T13:05:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![machinecommune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@machinecommune](https://forums.unrealengine.com/u/machinecommune)\
**Post date:** [August 2, 2019, 1:05pm UTC](https://forums.unrealengine.com/t/timeline-playing-twice-as-fast-in-c/129468/1 "2019-08-02T13:05:41Z")

</div>

I made two floating objects, one in C++, and one in Blueprints. I use the same float curve for both timelines. For some reason, the C++ object moves twice as fast! I haven’t adjusted the playback rate or anything else that would affect it, so I can’t figure out why.

I’ve attached the code for this actor. If you un-comment the SetPlayRate(0.5f) call in the constructor, it will move the same speed as the blueprint!

Anyone know what is going on here?

Thanks!

---

<div class="post-metadata">

**Author:** ![Zhi\_Kang\_Shao](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Zhi\_Kang\_Shao](https://forums.unrealengine.com/u/Zhi_Kang_Shao)\
**Post date:** [August 11, 2019, 6:21pm UTC](https://forums.unrealengine.com/t/timeline-playing-twice-as-fast-in-c/129468/2 "2019-08-11T18:21:44Z")

</div>

You don’t need to manually call TickComponent, since this is automatically done by the AActor. 🙂 TickComponent being called twice per frame is causing what you see.

```auto

void AFloatingTorusActor::Tick(float DeltaTime)
{
    Super::Tick(DeltaTime);

    // This is wrong
    TimelineComponent->TickComponent(DeltaTime, ELevelTick::LEVELTICK_TimeOnly, nullptr);
}

```

---

<div class="post-metadata">

**Author:** ![machinecommune](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@machinecommune](https://forums.unrealengine.com/u/machinecommune)\
**Post date:** [August 12, 2019, 1:00am UTC](https://forums.unrealengine.com/t/timeline-playing-twice-as-fast-in-c/129468/3 "2019-08-12T01:00:45Z")

</div>

Thank you so much for your response, that is correct. I do wonder why the tutorials online, for example, [A new, community-hosted Unreal Engine Wiki - Announcements and Releases - Unreal Engine Forums](https://wiki.unrealengine.com/Timeline_in_c%2B%2B) have this mistake in them. I’m guessing something changed in the engine at some point to remove that need.

Thank you so much!
