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

SurfaceGUI Button not Changing Players Camera Position?

Asked by
Rynappel 212 Moderation Voter
4 years ago

I have a script which is supposed to change the players camera position when they click a button in a SurfaceGUI, how ever this does not work and I do not know why. Can you help?

LocalScript:

local player = game.Players.LocalPlayer
local character = player.Character
local camera = workspace.CurrentCamera

script.Parent.MouseButton1Click:Connect(function()
    local plr = game.Players.LocalPlayer
    local cam = workspace.CurrentCamera

    repeat wait()
        cam.CameraType = Enum.CameraType.Scriptable
    until cam.CameraType == Enum.CameraType.Scriptable
    cam.CFrame = script.Parent.Parent.Parent.Parent.CameraPart.CFrame
end)
0
where did u put the SurfaceGui? Luka_Gaming07 534 — 4y
0
in the part Rynappel 212 — 4y

Answer this question