Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How could I make this FOV script more simple?

Asked by
zle_n 9
5 years ago

I'm trying to make a changing FOV script, but I want to make it smooth so it takes a long time. I bet there's a easier way of doing it, but I just can't think of it if anyone knows please help me. Thanks

Code:

workspace.CurrentCamera.FieldOfView = 69.9
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.8
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.7
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.6
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.5
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.4
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.3
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.2
    wait(2)
    workspace.CurrentCamera.FieldOfView = 69.1
    wait(2)
    workspace.CurrentCamera.FieldOfView = 68

From 70 to 20 but like the example.

0
Use the tween service. So the object is currentcamera, the setting is FieldOfView, you want it to go to 20 over 5 seconds. Then the reverse. littlemannyman 20 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago
for i=69.9,20,-0.1 do
    workspace.CurrentCamera.FieldOfView = i
    wait(2)
end

Remember to always use for loops for iterative processes like this :P

0
Should be using the tween service. littlemannyman 20 — 5y
0
Thank you! zle_n 9 — 5y
0
@littlemannyman yeah, but he specifically said "like this example" Internal_1 344 — 5y
Ad

Answer this question