How to revert to default camera?

HEWO!!!
OK!
so,

I have a script that sets the player’s camera to a block, how can I set it back to the default camera?
here’s the script:
local camera = workspace.CurrentCamera

while wait() do
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = workspace.CarCam.CFrame
end

THANKS!!!

2 Likes

Just set the CameraType back to Custom. Example:

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Custom

In your case you probably want to end the loop so just add a check so that whenever the CameraType is changed it breaks the loop:

while wait() do
	if (workspace.CurrentCamera.CameraType == Enum.CameraType.Custom) then
		break
	end

	workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
	camera.CFrame = workspace.CarCam.CFrame
end
4 Likes

Ok! Ill look at a this! Thanks!!

know how to make a camera tween to the players camera?

I usually tween the camera to (root.CFrame - root.CFrame.LookVector * 10) + Vector3.new(0, 0.25, 0).

1 Like