2JJ1
|
  |
| Joined: 15 Mar 2012 |
| Total Posts: 1571 |
|
|
| 24 Jul 2015 09:43 AM |
Is there any form of DeltaTime in rLua?
I've been introduced to it in c#,javascript, and LoveLua but never heard of it on here. If there is, please give a short example script using it c: |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 10:05 AM |
Research os.time() and os.difftime() http://wiki.roblox.com/index.php?title=Function_dump/Basic_functions#os.time That's the best you can do. Note that os.difftime() will just return the difference between two numbers, but used in conjunction with os.time and a date table it can be useful. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 24 Jul 2015 10:32 AM |
DeltaTime for you is the time for the render because you're probably a Unity user.
As it stands, Roblox isn't designed to work based on render times like a game engine. You can use tick() to get the difference between the last RenderStep and now, but in most cases you'll be using the Delta from wait() |
|
|
| Report Abuse |
|
|
|
| 24 Jul 2015 10:42 AM |
local DeltaTime = 0
local T = tick() local TT game:GetService("RenderService").RenderStepped:connect(function() TT=tick() DeltaTime = TT-T T=TT end)
That's is what delta time is to my understanding? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 24 Jul 2015 12:04 PM |
local ti = tick(); game:GetService("RunService").RenderStepped:wait(); local tf = tick();
print("delta time", tf - ti); |
|
|
| Report Abuse |
|
|