timer.every
Schedules a repeating callback.
Syntax
ue.timer.every(interval_seconds: number, callback: function) -> integerParameters
| Parameter | Type | Description |
|---|---|---|
interval_seconds | number | Interval greater than zero. |
callback | function(id) | Function called with the timer ID. |
Returns
| Type | Description |
|---|---|
integer | Timer registration ID. |
Example
local id = ue.timer.every(1.0, function()
print("one second elapsed")
end)Notes
- A repeating timer is cancelled automatically if its callback errors.