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

Why does the camera get glitched up after being "fixed"?

Asked by
Prioxis 673 Moderation Voter
10 years ago

When a player joins the game on the mainGUI I have it set up for the camera to Rotate around a part in the Workspace... And that event is triggered by a button well theres another button thats suppose to trigger the exact opposite (making the camera go back to normal..) but when it does that the player can't rotate his camera or his camera is just stuck...

Script 1 (Rotates Camera)

NewCam.CameraType = Enum.CameraType.Scriptable
NewCam.FieldOfView = 30
NewCam.CameraSubject = target
GUI:TweenPosition(UDim2.new(1, 0, 1, 0), "Out", "Quad", 3)
GUI2:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Quad", 2)
while wait() do
    NewCam.CoordinateFrame = CFrame.new(target.Position) * CFrame.Angles(0, angle, 0) * CFrame.new(0, 0, 5)   
    angle = angle + math.rad(1)

Script 2 (Stops the Camera from Rotating)

script.Parent.MouseButton1Down:connect(function(click)
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.Classic
camera.CameraType = "Custom"
camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
camera.FieldOfView = 70
print 'CamScript Worked!'
print(game.Players.LocalPlayer.Name..' is now being Teleported..')
GUI:TweenPosition(UDim2.new(1, 0, 1, 0), "Out", "Quad", 3)
wait(1)
GUI2:TweenPosition(UDim2.new(0, 0, 0, 0), "In", "Quad", 2)

wait(2)

Answer this question