Timer
![timer](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/timer-3aca207ee32e12d4a251751523068ef6.png)
Use Timer as a timer. Timer is in the Time category.
Input
Name | Data Type | Description |
---|---|---|
Start | Trigger | Execute to start the timer. |
Pause | Trigger | Execute to pause the timer. |
Resume | Trigger | Execute to resume the timer. |
Duration | Number (Double) | Duration time, in seconds, of the timer. |
Output
Name | Data Type | Description |
---|---|---|
Started | Trigger | Execute the next node when the timer starts. |
Tick | Trigger | Execute the next node each frame. |
Completed | Trigger | Execute the next node when the timer stops. |
Elapsed Time | Double | The number of seconds elapsed since the timer started. |
Progress | Double | The proportion of duration that has elapsed (0-100%). |
Remaining | Double | The number of seconds remaining until the timer ends. |
Example
![timer example](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/timer_example-96dd561fcaf66658ec431c404468def4.gif)
This example uses the percentage of time passed in the timer to change the color of sphere.
![timer node](http://lf16-tiktok-common.tiktokcdn-us.com/obj/tiktok-web-common-tx/effect/learn/assets/images/timer_node-6a76fd3538612e1f6435a569fa5e98eb.png)