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

Camera Glitch, help?

Asked by 8 years ago

I have a glitch where the the screen either turns black or all I see is the skybox. This never happened to me before and I don't know how to fix it. This is a script I used to fix it but the player has to know to click that button so it can be fixed. Also, when clicked, he player teleports to 0,0,0 which I don't want to happen!


script.Parent.MouseButton1Click:connect(function() workspace.CurrentCamera:Destroy() workspace.CameraSubject = script.Parent.Parent.Parent.Parent.Character.Humanoid workspace.CameraMode = "Custom" end)

Is there another way to fix this without having the player click a button, or this is the only way to fix it?

0
It would be very helpful if you can give us the cause of the problem in the first place. Providing your fix is not useful to us. XAXA 1569 — 8y

1 answer

Log in to vote
0
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
8 years ago

Destroying the camera is possibly the error. Also on line 3 and 4, you never mentioned the CurrentCamera. So, what I suggest:

-- Local Script
script.Parent.MouseButton1Click:connect(function()
    game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoide
    game.Workspace.CameraMode = "Custom"
end)
0
The script in the OP is the *fix* to the problem. "Is there another way to fix this without having the player click a button, or this is the only way to fix it?" XAXA 1569 — 8y
Ad

Answer this question