Hi, so I am making a menu for my game where the background is just the camera.
local cc = workspace.CurrentCamera
local pc = workspace:WaitForChild("PlayCam")
task.wait(0.001)
cc.CameraType = Enum.CameraType.Scriptable
cc.CFrame = pc.CFrame
local function playerEntered()
cc.CFrame = pc.CFrame
end
game.Players.PlayerAdded:Connect(function()
playerEntered()
end)
local plr = game.Players.LocalPlayer
script.Parent.Frame.Play.MouseButton1Down:Connect(function()
local character = game.Workspace:WaitForChild(plr.Name)
if character then
wait(1)
cc.CFrame = character.Head.CFrame
cc.CameraType = Enum.CameraType.Custom
end
end)
When it sets the camera back to the head:
script.Parent.Frame.Play.MouseButton1Down:Connect(function()
local character = game.Workspace:WaitForChild(plr.Name)
if character then
wait(1)
cc.CFrame = character.Head.CFrame
cc.CameraType = Enum.CameraType.Custom
end
end)
It just sets it to the place the play was before they clicked play.