So I want to make a camera for my menu, in the background.
I have that working but I just need to reset it
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 function play()
cc.CFrame = pc.CFrame
end
script.Parent.Frame["Fp Team"].MouseButton1Down:Connect(function()
-- Reset camera
end)
script.Parent.Frame["Deeds Team"].MouseButton1Down:Connect(function()
-- Reset camera
end)```
Help appriciated.
try get the players character and set the cc.CFrame to the characters head. also add a line of code to make the cc.CameraType to custom.
local plr = game.Players.LocalPlayer
local character = plr.Character or plr.Character:Wait()
script.Parent.Frame["Fp Team"].MouseButton1Down:Connect(function()
if character then
cc.CFrame = character.Head.CFrame
cc.CameraType = Enum.CameraType.Custom
end
end)
script.Parent.Frame["Deeds Team"].MouseButton1Down:Connect(function()
if character then
cc.CFrame = character.Head.CFrame
cc.CameraType = Enum.CameraType.Custom
end
end)
i dont even think you need to add the cc.CFrame = character.Head.CFrame part