I'm creating a start screen, but when the player clicks 'Play' the camera doesn't reset like it's supposed to. There is no output, and the camera seems to be simply set free. What am I doing wrong?
local plr=game.Players.LocalPlayer
local cam=Workspace.CurrentCamera
local freezePosition=Workspace.StartCameraPart.CFrame
while script.Parent:findFirstChild("CamEnabled")==nil do wait() end
while script.Parent.CamEnabled.Value==true do
cam.CameraType="Scriptable"
cam.CameraSubject=nil
cam.CoordinateFrame=freezePosition
game:GetService("RunService").RenderStepped:wait()
end
cam.CameraType="Fixed"
cam.CameraSubject=plr.Character.Humanoid
cam.CoordinateFrame=plr.Character.Head.CFrame
script.Parent:remove()

2 comments
It works! Thanks!
No problem! :)