Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago

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

Ad
Log in to vote
0
Answered by
Andorks 23
8 years ago

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

Log in to vote
0
Answered by 8 years ago
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

Answer this question