# How to set timer with game instance

**URL:** <https://forums.unrealengine.com/t/how-to-set-timer-with-game-instance/423066>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 19, 2018, 5:03pm UTC](https://forums.unrealengine.com/t/how-to-set-timer-with-game-instance/423066 "2018-04-19T17:03:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meious](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meious](https://forums.unrealengine.com/u/Meious)\
**Post date:** [April 19, 2018, 5:03pm UTC](https://forums.unrealengine.com/t/how-to-set-timer-with-game-instance/423066/1 "2018-04-19T17:03:03Z")

</div>

Hello, I have been struggling for days trying to figure out how to reduce a variable value over time that is stored in my game instance. I have watched many videos and tried replicating what I have seen but none of those videos deal with the game instance. I can reduce the variable value just fine running it in any other BP accept for the game instance. (Update: The screen shot you see is in my third person character event graph)

To clarify what I am attempting to do is: I want the population of my city to consume food over time and reduce the value (level) of food stored. And I need that value to persist in any level (not reset when entering a new level)

Just to make sure I cover all my bases, I have the instance properly set in the maps and modes, I have the variables set in the instance with the proper values set.

![238146-instanceissue.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/2/3/e23cf8867b74d648fa3276df15ab0a8d87c65581.png)

Please Help!

---

<div class="post-metadata">

**Author:** ![engelmanna](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@engelmanna](https://forums.unrealengine.com/u/engelmanna)\
**Post date:** [April 20, 2018, 4:15pm UTC](https://forums.unrealengine.com/t/how-to-set-timer-with-game-instance/423066/2 "2018-04-20T16:15:25Z")

</div>

Is ‘Zombie Ref’ a reference to your gameinstance class?

---

<div class="post-metadata">

**Author:** ![Meious](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Meious](https://forums.unrealengine.com/u/Meious)\
**Post date:** [April 22, 2018, 5:20pm UTC](https://forums.unrealengine.com/t/how-to-set-timer-with-game-instance/423066/3 "2018-04-22T17:20:04Z")

</div>

Yes it is.
