Stormworks: Build and Rescue

Stormworks: Build and Rescue

Stormworks Custom Content Workshop
Find, rate and try out the best community vehicles in Stormworks!
Lua time delta
in Lua how could i get the time delta of a value?
< >
Showing 1-1 of 1 comments
GrumpyOldMan 70 10 Apr, 2024 @ 8:27pm 
Time between ticks is always 1/60 seconds.
To get the delta of a value per tick, simply subtract current value from the last ticks value:
deltaValue, lastValue = 0, 0 function onTick() someValue = input.getNumber(1) deltaValue, lastValue = someValue - lastValue, someValue output.setNumber(1, deltaValue) end
This will give you change in value per tick. Multiply by 60 to get change per second.
< >
Showing 1-1 of 1 comments
Per page: 1530 50