# How to implement heartbeat game?

**URL:** <https://forums.unrealengine.com/t/how-to-implement-heartbeat-game/428717>\
**Category:** Audio\
**Tags:** click, unreal-engine, visual, question\
**Created:** [July 4, 2018, 9:09pm UTC](https://forums.unrealengine.com/t/how-to-implement-heartbeat-game/428717 "2018-07-04T21:09:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vu5e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vu5e](https://forums.unrealengine.com/u/Vu5e)\
**Post date:** [July 4, 2018, 9:09pm UTC](https://forums.unrealengine.com/t/how-to-implement-heartbeat-game/428717/1 "2018-07-04T21:09:28Z")

</div>

Hello again, just wanna ask how do you implement a game that you need to press button on a correct timing in which the visual and sound change on every correct input.

For example, player needs to reduce insanity so he needs to do the heartbeat game to reduce it. When event started, player need to press the correct input of button which have 3 stages. Visual and sound will be blurry and heartbeat sound is the fastest. As player click the correct button the visual and sound which were loud earlier became more clearer and no sound of heartbeat played anymore.

Thank you

---

<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:** [July 5, 2018, 1:49am UTC](https://forums.unrealengine.com/t/how-to-implement-heartbeat-game/428717/2 "2018-07-05T01:49:03Z")

</div>

Try to use timers

[https://docs.unrealengine.com/en-us/Gameplay/HowTo/UseTimers/Blueprints](https://docs.unrealengine.com/en-us/Gameplay/HowTo/UseTimers/Blueprints)

> **[Gameplay Timers](https://docs.unrealengine.com/5.1/en-US/gameplay-timers-in-unreal-engine/)**
>
> Timer construct for performing delayed or repeated actions

On first click start te timer and mark somewhere that it is active, and when timer pass make a miss code, on any other click check if timer past if not it’s OK reset timer if yes then nope (timer pass code should stop the check anyway). You can also use timer little diffrently like make longer time then target time and check timer status on click and make difference to target time, this way you can do some tollerance window if you want.

Remember that CPU don’t have sense of time and that timer code is executed in loop with other programs running by OS and it takes time for timers to be checked again, timers are checked on every frame (if im not mistaken) so if you have run 60FPS you got around 16ms accuracy

---

<div class="post-metadata">

**Author:** ![Vu5e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Vu5e](https://forums.unrealengine.com/u/Vu5e)\
**Post date:** [July 5, 2018, 6:00am UTC](https://forums.unrealengine.com/t/how-to-implement-heartbeat-game/428717/3 "2018-07-05T06:00:16Z")

</div>

Can you show it to me in blueprint because my english is not that good.
