# How to setup an accurate timing minigame

**URL:** <https://forums.unrealengine.com/t/how-to-setup-an-accurate-timing-minigame/414259>\
**Category:** Blueprint\
**Tags:** unreal-engine, delta-time, Blueprint, question\
**Created:** [January 10, 2018, 10:51pm UTC](https://forums.unrealengine.com/t/how-to-setup-an-accurate-timing-minigame/414259 "2018-01-10T22:51:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ShadowDogeLeo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ShadowDogeLeo](https://forums.unrealengine.com/u/ShadowDogeLeo)\
**Post date:** [January 10, 2018, 10:51pm UTC](https://forums.unrealengine.com/t/how-to-setup-an-accurate-timing-minigame/414259/1 "2018-01-10T22:51:53Z")

</div>

Hi,

Im trying to setup an accurate timing minigame in my game. I have it partly working but there’s an issue that when the cpu goes under load it goes out of sync.

This is my current BP script for handling the timing - [http://prntscr.com/hyqmsk](http://prntscr.com/hyqmsk)

For a rough idea of what it should look like I recorded a video of it working without going out of sync here: [PTA Timing - YouTube](https://www.youtube.com/watch?v=JEDk_bY40cU&feature=youtu.be)

You can see when I manage to get the timing right the bar at the top degrades.

At the moment it is set to work at 120BPM so it should become “hittable” twice a second. I’ve set the timings for the delay according to my animation for the square that’s travelling across the line. In my player controller, there is the code for handling a hit where when T is pressed it checks if its hittable and then handles if it is or isn’t hittable

[http://prntscr.com/hyqo50](http://prntscr.com/hyqo50) BP for that is here.

I was wondering if there’s a better way of handling this, I thought of using delta time but wasn’t sure how I’d implement it.

Thanks for any answers ^^

---

<div class="post-metadata">

**Author:** ![Loux\_xavier](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loux_xavier/32/1201519_2.png) [@Loux\_xavier](https://forums.unrealengine.com/u/Loux_xavier)\
**Post date:** [January 11, 2018, 5:33am UTC](https://forums.unrealengine.com/t/how-to-setup-an-accurate-timing-minigame/414259/2 "2018-01-11T05:33:50Z")

</div>

Hi, try this:

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/9/b/a9bf11948eae69b4d3980bb1715d62de9f684543.png) ](https://www.xavierloux.com/sharex/UE4Editor_2018-01-11_06-30-44.png)

It is possible to get server time with game state ^^
