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()
Let me know if this works
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="Custom"--Should be custom for the default player camera. cam.CameraSubject=plr.Character.Humanoid --cam.CoordinateFrame=plr.Character.Head.CFrame forget about this script.Parent:remove()
To make the camera just like it was before you changed anything:
worksapce.CurrentCamera.CameraType='Custom' workspace.CurrentCamera.CameraSubject=game.Players.LocalPlayer.Character:WaitForChild("Humanoid")