# Setting a timer from game mode

**URL:** <https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465>\
**Category:** Modding\
**Tags:** timer, unreal-engine, question\
**Created:** [August 20, 2014, 12:27am UTC](https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465 "2014-08-20T00:27:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PersonGUy223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PersonGUy223](https://forums.unrealengine.com/u/PersonGUy223)\
**Post date:** [August 20, 2014, 12:27am UTC](https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465/1 "2014-08-20T00:27:53Z")

</div>

I am trying to set a timer from begin play in my game mode, and when i do i get compiler errors

I’ve been looking around for a few hours and I can’t figure out what im doing wrong. Sorry if this is something simple i missed, i’m pretty awful at C++

this is the snippet of code

GetWorldTimerManager().SetTimer(this, &ACustomGameMode::StartRound, RoundStartTimerDuration, false);

heres the errors

error C2027: use of undefined type ‘FTimerManager’

error C2228: left of ‘.SetTimer’ must have class/struct/union

---

<div class="post-metadata">

**Author:** ![joeGraf](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@joeGraf](https://forums.unrealengine.com/u/joeGraf)\
**Post date:** [August 20, 2014, 10:26pm UTC](https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465/2 "2014-08-20T22:26:39Z")

</div>

It’s part of the ENGINE\_API so make sure you have Engine.h included

---

<div class="post-metadata">

**Author:** ![Shadowriver](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Shadowriver](https://forums.unrealengine.com/u/Shadowriver)\
**Post date:** [August 20, 2014, 10:27pm UTC](https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465/3 "2014-08-20T22:27:34Z")

</div>

Well thats odd, you doing that in ACustomGameMode class?

Try including TimerManager.h or add `class FTimerManager;` in header file before your class decleration

---

<div class="post-metadata">

**Author:** ![PersonGUy223](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@PersonGUy223](https://forums.unrealengine.com/u/PersonGUy223)\
**Post date:** [August 21, 2014, 12:08am UTC](https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465/4 "2014-08-21T00:08:48Z")

</div>

adding Engine.h worked, thanks!

---

<div class="post-metadata">

**Author:** ![Commander\_Shepard](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Commander\_Shepard](https://forums.unrealengine.com/u/Commander_Shepard)\
**Post date:** [May 21, 2018, 11:09am UTC](https://forums.unrealengine.com/t/setting-a-timer-from-game-mode/291465/5 "2018-05-21T11:09:50Z")

</div>

for anyone who comes by this, Engine.h is a monolithic header please use TimerManager.h instead
