# Timer

The timer prefab contains a Timer script with many customization options that can be used for various purposes.

The Timer script inspector will only show options that are applicable to the current settings.

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHoetspZY5MJUviLGmI%2FTimerScript.png?alt=media\&token=feef2a22-dd71-4905-9964-6b2c36b7ad88)

| Timer Options   |                                                                          |
| --------------- | ------------------------------------------------------------------------ |
| Timer State     | Controls if the timer is *Counting* or *Disabled.*                       |
| Timer Type      | Controls if the timer will count-up, count-down, or count-up infinitely. |
| Start Time      | Time the timer will start from.                                          |
| Finish Time     | Time the timer will stop.                                                |
| Timer Speed     | Rate at which the timer adds or subtracts time.                          |
| Use System Time | Timer will run as a clock and output system time.                        |

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHofQyFurH1iMZs0gW2%2FCount%20Up.png?alt=media\&token=865dfe80-e283-4abb-a204-3836dc2be6dc)

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHogDT4Bh8MF2-w-_Wj%2FCount%20Down.png?alt=media\&token=bcec204f-4f10-4165-83b9-8d785b1434f4)

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHoiE-WXbG1oX-KthWD%2FCount%20Up%20Infinite.png?alt=media\&token=0847953d-e875-4bc3-8f16-3c132513bd2e)

| Time Events | Create a list of custom events, the timer will trigger when the assigned time is reached. |
| ----------- | ----------------------------------------------------------------------------------------- |
| Event Name  | The name of the custom time event.                                                        |
| Event Time  | The time the event will be triggered.                                                     |
| Time Event  | The event that's invoked when the event time is reached.                                  |

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHohHxIVc2spLBk7Qed%2FTime%20Events.png?alt=media\&token=436a7965-b8fa-4487-ae1c-acdf42b4cdc0)

| **Time's Up Event Options** |                                                                           |
| --------------------------- | ------------------------------------------------------------------------- |
| Set Zero Timescale          | Sets Time.timescale to 0.                                                 |
| Times Up Event              | A UnityEvent that can trigger custom scripting functions when time is up. |

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHohgtK6w-hYpUC5GIL%2FTime%20Is%20Up%20Event.png?alt=media\&token=c8de9e60-e3c1-4b2d-939e-01e2f6f2969c)

| UI Text Output     |                                                                             |
| ------------------ | --------------------------------------------------------------------------- |
| Text Type          | Assign a default Unity UI Text or Text Mesh Pro UGUI component.             |
| Timer Text Default | Assign a UI Text component to output a formatted string.                    |
| Timer Text TMPUGUI | Assign a Text Mesh Pro UGUI component to output a formatted string.         |
| Display Options    | Toggle specific time value fields in the output string.                     |
| Leading Zero       | Toggle the leading zero on specific time value fields in the output string. |

![](https://2995880939-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MCdDMueCJF-kxXjHxEp%2F-MHod-oqL-KKQx0BnnNN%2F-MHoeE3E4edgeXiO8ZjL%2FUITextOutput.png?alt=media\&token=0e7ba182-2d54-4e70-aa3f-45ce8bba6721)
