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
|
  |
| 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
|
  |
| Joined: 17 Jun 2013 |
| Total Posts: 23601 |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 09 Jun 2016 01:50 AM |
have no idea what those words mean but ok
ho ho ho |
|
|
| Report Abuse |
|
|
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 |
|
|