Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How could I make this FOV script more simple?

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.

2 comments

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.

1 answer

✓ Accepted answer
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

3 comments

0

Should be using the tween service.

0

Thank you!

0

@littlemannyman yeah, but he specifically said "like this example"

This discussion is preserved as it was. New answers, comments, and votes are closed.