Is there a way to make this more smooth?
I've made a sprinting script when you press 'q', you sprint. Your camera also zooms out a little. But when you rapidly press 'q' the camera looks bad. How would i go about making it look smother?
here is the script:
01 | mouse = game.Players.LocalPlayer:GetMouse() |
03 | mouse.KeyDown:connect( function (key) |
05 | script.Parent:TweenSize(UDim 2. new( 0 , 100 , 0 , 50 ), "InOut" , "Quad" , 2 , true ) |
06 | script.Parent:TweenSize(UDim 2. new( 1 , 100 , 0 , 50 ), "InOut" , "Quad" , 6 , false ) |
08 | script.Parent.BackgroundColor 3 = Color 3. new( 0 , 0 , 1 ) |
09 | if game.Workspace.CurrentCamera.FieldOfView ~ = 80 then |
11 | game:GetService( "RunService" ).RenderStepped:wait() |
12 | game.Workspace.CurrentCamera.FieldOfView = i |
18 | mouse.KeyUp:connect( function (key) |
20 | script.Parent.BackgroundColor 3 = Color 3. new( 0 , 1 , 0 ) |
21 | script.Parent:TweenSize(UDim 2. new( 1 , 100 , 0 , 50 ), "InOut" , "Quad" , 6 , true ) |
22 | script.Parent:TweenSize(UDim 2. new( 0 , 100 , 0 , 50 ), "InOut" , "Quad" , 2 , false ) |
23 | if game.Workspace.CurrentCamera.FieldOfView ~ = 70 then |
25 | game:GetService( "RunService" ).RenderStepped:wait() |
26 | game.Workspace.CurrentCamera.FieldOfView = i |
here is the game so you see what it looks like:
http://www.roblox.com/games/197480972/---