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 » Club Houses » Clans & Guilds
Home Search
 

noob lua question

Previous Thread :: Next Thread 
Laedere is not online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
09 Jun 2016 01:40 AM
can someone give me an example of RenderStepped
Report Abuse
Unclear is not online. Unclear
Joined: 27 Aug 2011
Total Posts: 17060
09 Jun 2016 01:42 AM
-- In a LocalScript

local perfectlySyncedSpinningPart = Instance.new("Part", workspace)
perfectlySyncedSpinningPart.Anchored = true

game:GetService("RunService").RenderStepped:connect(function(delta)
perfectlySyncedSpinningPart.CFrame = perfectlySyncedSpinningPart.CFrame*CFrame.Angles(0, 2*math.pi*delta, 0)
end)

-- sorry this is messy, wrote this just now
Report Abuse
Laedere is not online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
09 Jun 2016 01:43 AM
ty
Report Abuse
Unclear is not online. Unclear
Joined: 27 Aug 2011
Total Posts: 17060
09 Jun 2016 01:44 AM
RenderStepped is an event that is triggered as fast as possible on the client. In other words, it runs each frame.

It returns a single parameter (I refer to this parameter as delta). Delta is the time elapsed between the current RenderStepped frame and the last RenderStepped frame.

The delta parameter is particularly useful because it allows you to run things in-sync with the client's frame rate (allowing for "smooth" animations and calculations). When you describe things as equations and set the equations in terms of delta, you can ensure that no matter what the client's frame rate is (slow or super fast), the animation plays in-sync with the amount of time that has elapsed in real life.
Report Abuse
fireup12 is not online. fireup12
Joined: 14 Nov 2009
Total Posts: 16
09 Jun 2016 01:49 AM
tbh unclear u taughtme something 2 day


i nvr knew delta was provided by renderstepped ty
Report Abuse
Britney178 is not online. Britney178
Joined: 31 Dec 2011
Total Posts: 2668
09 Jun 2016 01:50 AM
have no idea what those words mean but ok

ho ho ho
Report Abuse
Theta0 is not online. Theta0
Joined: 09 Feb 2011
Total Posts: 40750
09 Jun 2016 01:57 AM
game:GetService("RunService").RenderStepped:connect(function(delta)
perfectlySyncedSpinningPart.CFrame = perfectlySyncedSpinningPart.CFrame*CFrame.Angles(0, 2*math.pi*delta, 0)
end)

delta is in the first line

you can name it whatever you want


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » Clans & Guilds
   
 
   
  • 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