Script:delta_time
Returns the delta time that was passed to the last Script:update call.
Scripts do not always run within a Script:update call where this delta_time value makes sense. For example, scripts can run in response to a Script:signal call.
Usage
script:delta_time()
Returns
| Name | Type | Description |
|---|---|---|
delta_time | number | Delta time in seconds. |
Examples
local script = crystal.Script:new(function(self)
print(self:delta_time());
end);
script:update(0.01); -- prints 0.01