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

How to turn the CurrentCamera back to normal?

I want to turn my camera back to normal but the script that I made doesn't work, if anyone could help me, I would appreciate that very much.

Code:

function onTouched(hit)
	repeat wait()
	Camera.CameraType = Enum.CameraType.Scriptable
until Camera.CameraType == Enum.CameraType.Scriptable
	Camera.CFrame = workspace.CameraPart.CFrame
	for i=69.9,40,-0.05 do
		workspace.CurrentCamera.FieldOfView = i
		wait(0.2)
	end
	wait(59) --Here
	Camera.CameraType = Enum.CameraType.Fixed
	Camera.CFrame = workspace.CurrentCamera.CFrame
	end --End


game.Workspace.Touch.Touched:Connect(onTouched)

from here to end.

1 comment

0

You have to "repeat wait()" on line 11 for it to switch back to "Enum.CameraType.Fixed", just like you did in lines 2-4

1 answer

✓ Accepted answer

On line 11, use "repeat wait()" since setting the CurrentCamera.CameraType to a Enum.CameraType only once won't work:

repeat wait() 
	workspace.CurrentCamera.CameraType = Enum.CameraType.Fixed 
until workspace.CurrentCamera.CameraType == Enum.CameraType.Fixed

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