I'm trying to make a main menu that shows a scene, so I linked the camera CFrame to a Parts CFrame.
local player = game.Players.LocalPlayer local character = player.Character local camera = workspace.CurrentCamera repeat wait() camera.CameraType = Enum.CameraType.Scriptable until camera.CameraType == Enum.CameraType.Scriptable script.Parent.ScreenGui.TextButton.MouseButton1Click:Connect(function() script.Parent.ScreenGui.TextButton.Visible = false repeat wait() camera.CameraType = Enum.CameraType.Custom until camera.CameraType == Enum.CameraType.Custom end)
Basically, the button doesn't even work and when I spawn in, the camera is stuck in the air.
http://gyazo.com/879ede2ca5259b3400e09d3956db24f5
Any fixes please?
MouseButton1Click doesn't seem to ever work for me. Try changing it to:
local player = game.Players.LocalPlayer local character = player.Character local camera = workspace.CurrentCamera repeat wait() camera.CameraType = Enum.CameraType.Scriptable until camera.CameraType == Enum.CameraType.Scriptable script.Parent.ScreenGui.TextButton.MouseButton1Down:Connect(function() script.Parent.ScreenGui.TextButton.Visible = false repeat wait() camera.CameraType = Enum.CameraType.Custom until camera.CameraType == Enum.CameraType.Custom end)
Also you're missing the camera CFrame part so basically it would look like this
local player = game.Players.LocalPlayer local character = player.Character local camera = workspace.CurrentCamera repeat wait() camera.CameraType = Enum.CameraType.Scriptable until camera.CameraType == Enum.CameraType.Scriptable camera.CFrame = workspace.{PartNameHere}.CFrame script.Parent.ScreenGui.TextButton.MouseButton1Down:Connect(function() script.Parent.ScreenGui.TextButton.Visible = false repeat wait() camera.CameraType = Enum.CameraType.Custom until camera.CameraType == Enum.CameraType.Custom end)