generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Delta Time

Previous Thread :: Next Thread 
2JJ1 is not online. 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
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
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 is not online. 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
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image