I am having an issue with camera manipulation, seen below in this video: https://streamable.com/7yqmj4
My code for the first client manipulation to send them to the spawn screen
local cam = workspace.CurrentCamera
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local rem = game.ReplicatedStorage.ChangeCam
rem.OnClientEvent:Connect(function()
char:WaitForChild("HumanoidRootPart").CFrame = workspace.SpawnPad.CFrame + Vector3.new(0,10,0)
cam.CameraType = Enum.CameraType.Scriptable
cam.Focus = CFrame.new(workspace.CamPart.CFrame.LookVector)
cam.CFrame = workspace.CamPart.CFrame
end)
char:WaitForChild("Humanoid").Died:Connect(function()
plr.CharacterAdded:Wait()
char:WaitForChild("HumanoidRootPart").CFrame = workspace.SpawnPad.CFrame + Vector3.new(0,10,0)
cam.CameraType = Enum.CameraType.Scriptable
cam.Focus = CFrame.new(workspace.CamPart.CFrame.LookVector)
cam.CFrame = workspace.CamPart.CFrame
rem.Parent.ShowUi:FireServer(plr)
end)
My code for resetting the camera on gui trigger
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
game.ReplicatedStorage.ShowUi.OnClientEvent:Connect(function()
script.Parent.Enabled = true
end)
script.Parent.TextButton.MouseButton1Click:Connect(function()
print(cam.CameraType)
cam.CameraType = "Custom"
char:WaitForChild("HumanoidRootPart").CFrame = workspace.SpawnPad.CFrame + Vector3.new(0,10,0)
print(cam.CameraType)
script.Parent.Enabled = false
end)
If anyone can help me, that would be great!