I finally got a gui to work that I have been working on for a while, It works whenever I run it in studio. But when I play the actual game, when I click the gui text button, it doesnt change the camera. Does anyone know why this happens? Here is my normal script under textbutton, under screengui, under startergui:
local Camera = workspace.CurrentCamera
function onClicked(GUI)
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = workspace.CustomizePart.CFrame-- CustomizePart is the part that the camera switches to
script.Parent.Parent:remove()--This removes the gui once the camera has changed.
end
script.Parent.MouseButton1Click:connect(onClicked)
|