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: Getting this for loop to work faster

Previous Thread :: Next Thread 
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:22 AM
for i=70,20, -1 do
print(i)
workspace.CurrentCamera.FieldOfView = i
end
end



...

Not using waits makes it happen instantly, using any sort of wait makes it happen too slowly, increasing the amount it is subtracted by makes it look very jittery. Help?
Report Abuse
0_1195 is not online. 0_1195
Joined: 21 Dec 2011
Total Posts: 268
10 Oct 2016 10:25 AM
Use:
wait()
or
game:GetService("RunService").RenderStepped:wait()


\_(siggy)_/
Report Abuse
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:29 AM
" using any sort of wait makes it happen too slowly"


I want it to reach 20 almost instantly but I want the FOV to visibly scope in / reduce whatever
Report Abuse
0_1195 is not online. 0_1195
Joined: 21 Dec 2011
Total Posts: 268
10 Oct 2016 10:34 AM
game:GetService("RunService").RenderStepped:wait() ????


\_(siggy)_/
Report Abuse
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:37 AM
I have already tried wait() and I have already tried renderstepped waiting

Still too slow
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Oct 2016 10:38 AM
make the increment -5 or -10 if you want it to zoom faster...
Report Abuse
CodeBreadpudding is not online. CodeBreadpudding
Joined: 24 Aug 2016
Total Posts: 1286
10 Oct 2016 10:39 AM
wait(0) is an option.
Report Abuse
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:39 AM
"increasing the amount it is subtracted by makes it look very jittery"
Report Abuse
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:40 AM
Hmm... wait(0) still takes too long.

Surely there's a way to do this faster
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Oct 2016 10:41 AM
then you are doing something wrong

there is no reason that using a runservice event tied with whatever increment you want isn't smooth

phantom forces does it, and if that's not smooth to you, there's nothing more you can do on ROBLOX
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Oct 2016 10:42 AM
there's surely not a way to do it faster than about 60 FPS because roblox is capped at that speed and so you can't do it any faster

but 60 FPS is plenty smooth -_- especially for ROBLOX
Report Abuse
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:47 AM
https://youtu.be/mVtqVY-IP5o?t=7s is a good example of what I'm trying to do here

"phantom forces does it"

It does change the FoV but not the way I want to do it. Look at the link

"there is no reason that using a runservice event tied with whatever increment you want isn't smooth"

It's either not smooth enough or not fast enough. Decreasing the fov by something like 5 or 10 is noticeably jittery, decreasing by 1 takes far too long to be reasonable
Report Abuse
storm_xst is not online. storm_xst
Joined: 27 Jul 2016
Total Posts: 1205
10 Oct 2016 10:49 AM
workspace.CurrentCamera.FieldOfView = 60
for i=40,20, -3.5 do
print(i)
wait(0)
workspace.CurrentCamera.FieldOfView = i
end
end


----

This is the best I've gotten, still looks a little jittery though.
Report Abuse
AggressiveCatch is not online. AggressiveCatch
Joined: 17 Jul 2011
Total Posts: 5840
10 Oct 2016 10:52 AM
it's extremely unlikely that your eye can really discern frames at 60 FPS, and there's no way to make it faster on ROBLOX

that's all I got to say, so use a runservice event instead of a loop with a wait and that's as best as you can get it
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