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

Why does the camera not return to the player after the gui is closed?

Well I've recently been scripting my new game and unfortunately the camera will not revert to the player after you close the gui. I would like some help if you need the scripts I made I can give them to you. Thanks!

3 answers

We need the scripts in order to see the error and fix it.

Please use the lua code block and paste your code in there, so it is formatted correctly.

game.Players.PlayerAdded:connect(function(player)
    script.LocalScript:clone().Parent = player.CharacterAdded:wait()
end)

--------That was the normal script

--------This is the LocalScript

game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
game.Workspace.CurrentCamera.CameraType = "Custom"
local cam = workspace.CurrentCamera
cam.CameraSubject=workspace.Part
cam.CameraType = "Watch"
cam.CoordinateFrame=CFrame.new(10,10,10)
cam.Focus=CFrame.new(10,10,10)
local target = workspace.Part
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
camera.CameraSubject = target
local angle = 0

while wait() do
    camera.CoordinateFrame = CFrame.new(target.Position)  --Start at the position of the part
                           * CFrame.Angles(0, angle, 0) --Rotate by the angle
                           * CFrame.new(0, 0, 5)       --Move the camera backwards 5 units
    angle = angle + math.rad(1)

end

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