Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
DannyCore
|
  |
| Joined: 25 Apr 2012 |
| Total Posts: 990 |
|
| |
|
Garnished
|
  |
| Joined: 09 Apr 2012 |
| Total Posts: 12695 |
|
| |
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 12 Jan 2013 07:11 PM |
Try wait() vs wait(0)...for...secret reasons...
Btw...velkommen back. |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 12 Jan 2013 08:17 PM |
| Probably more of their "mobile optimization". |
|
|
| Report Abuse |
|
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
| |
|
|
| 13 Jan 2013 10:58 AM |
How can you wait less than a frame?
The max number of frames is 30 and as far as I know you can't wait more than 1/30 since, ROBLOX limits the number of frames to 30 FPS.
☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞ |
|
|
| Report Abuse |
|
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
|
| 13 Jan 2013 11:00 AM |
@Candy,
Workspace.Changed occurs more than once a frame. |
|
|
| Report Abuse |
|
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
| |
|
|
| 13 Jan 2013 11:51 AM |
Lolwut?
print(wait(0)) --> 0.040481849987557
print(wait(0.00001)) --> 0.01686953110881
print(wait(0.0000001)) --> 1.6208624344927e-006 |
|
|
| Report Abuse |
|
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 13 Jan 2013 12:25 PM |
| Use RunService.Stepped for better/perfect timing. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 13 Jan 2013 12:42 PM |
@caiks:
I found something, possibly, interesting, with this script: game:GetService("RunService").Stepped:connect(function(t, s) print(t, s) end)
I got this (cut down) output:
4.0666668787599 0.033333335071802 4.1000002138317 0.033333335071802 4.1333335489035 0.033333335071802 4.1666668839753 0.033333335071802 4.2000002190471 0.033333335071802 4.2333335541189 0.033333335071802 4.2666668891907 0.033333335071802
Now note how the 'step' (s variable) is always the same unlike print(wait()) ...
cOLD? |
|
|
| Report Abuse |
|
|
DannyCore
|
  |
| Joined: 25 Apr 2012 |
| Total Posts: 990 |
|
| |
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 13 Jan 2013 01:45 PM |
@TheMyrco Like I said, it has better timing.
Here's an example with wait: local camera = workspace.CurrentCamera local part = game.Players.LocalPlayer.Character.PrimaryPart camera.CameraType = "Scriptable" while true do camera.CoordinateFrame = CFrame.new(part.Position + Vector3.new(10, 10, 10), part.Position) camera.Focus = CFrame.new(part.Position) wait() end This one will often lag.
Here's an example with stepped: local camera = workspace.CurrentCamera local part = game.Players.LocalPlayer.Character.PrimaryPart local runService = game:GetService("RunService") camera.CameraType = "Scriptable" while true do camera.CoordinateFrame = CFrame.new(part.Position + Vector3.new(10, 10, 10), part.Position) camera.Focus = CFrame.new(part.Position) runService.Stepped:wait() end This one will move smoothly.
This might be the reason ROBLOX used Stepped instead of wait in the loop of their rocket script. |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 13 Jan 2013 01:53 PM |
@Licaiks: Why not just use runService.Stepped:connect(func)? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 13 Jan 2013 02:09 PM |
I do that normally, but in this case I replaced wait by RunService.Stepped:wait to demonstrate the difference. I would rewrite it like this: local camera = workspace.CurrentCamera local part = game.Players.LocalPlayer.Character.PrimaryPart local runService = game:GetService("RunService") camera.CameraType = "Scriptable" runService.Stepped:connect(function() camera.CoordinateFrame = CFrame.new(part.Position + Vector3.new(10, 10, 10), part.Position) camera.Focus = CFrame.new(part.Position) end) |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 02:10 PM |
@Oysi
I dunno. But it seems that the more zeros you put in there, the quicker it gets. :3 That's why I use
wait(0.000000001)
when I need my animations to run really fast. :3 Oh, and can I have your method of using regular ROBLOX GUI's as a form of billboard GUI's? (Somebody told me you made this.) |
|
|
| Report Abuse |
|
|
noliCAIKS
|
  |
| Joined: 08 Mar 2010 |
| Total Posts: 917 |
|
|
| 13 Jan 2013 02:11 PM |
@Oysi I'm not sure if I understand what you're doing, but... Try setting the weld's C0 and C1 and the parts' CFrames accordingly so that the following is true: Part0.CFrame * C0 = Part1.CFrame * C1 |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 03:21 PM |
1) Open Studio. 2) Tools/Settings 3) Say okay to noob warning message. 4) Go to 'Lua' tab. 5) Set DefaultWaitTime to what you want.
Or am I wrong? |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 03:22 PM |
i'm guessing that would only affect the client, and thus localscripts. server-side scripts would run on normal DefaultWaitTime.
^ that information is highly theoretical, don't quote me on that. lol |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 03:22 PM |
@Destroyer Yes, that works for you, but for the other people playing his game, it will look laggy and run slower than what his would. |
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 03:38 PM |
print(wait(-math.huge)) 0.037953795379536 43.555126758593
print(wait(math.huge)) 0.037999348146315 31.010476257385
0_o
I can't get the wait() lower than ~0.03
|
|
|
| Report Abuse |
|
|
|
| 13 Jan 2013 04:01 PM |
@thek00lkid
print(wait(0.00001)) --> 0.01686953110881 |
|
|
| Report Abuse |
|
|