# Quick Time Events

SF includes a simple, yet effective solution for creating Quick Time Events (QTE) that can assign custom logic both when the player successfully completes the QTE, or fails it. QTE's are driven through a single function that contains all of the properties needed to create QTE's both during gameplay, and inside any sequence. This function gets called from an Interaction Manager reference.

<figure><img src="https://3388235609-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUYeqvDsstN2ZNva2Lkl7%2Fuploads%2F6rMBs4VHROEA7Yb9oJBj%2FQuickTimeEvent.png?alt=media&#x26;token=524d5f54-00c9-4408-b958-76ced1ec3200" alt=""><figcaption></figcaption></figure>

The QTE function currently supports 2 QTE/Event types,

* On Timer (OT)\
  A prompt popup with a defined "time" value that starts reducing as the QTE is created. When the set input key is pressed, this function will call the `On Success` event dispatcher.
* Target Key Presses (TKP)\
  A prompt popup that also uses a defined "time" value, but also takes into account a set "Num of Presses" value. This means this QTE will need the player to press the target input key x amount of times to complete.

The `QTE Settings` structure will contain the "Time" & "Num of Presses" values to modify. Then, the `QTE Input` structure is where you will set the QTE key that the player needs to press (For keyboard and/or gamepad), an `Ignore Specified Keys` array that can contain a list of inputs to ignore, or won't fail the QTE if pressed and isn't the QTE key, and finally an option to `Ignore All Keys Except Targets` to only check if the player presses the target QTE key (This means it would be impossible to fail the QTE if the wrong input is pressed).

***
