So i'm making a spectate GUI, as the title states, but i'm having trouble changing the local current camera, how would i fix this?
target = script.Parent.Parent.TextBox.target.Value script.Parent.MouseButton1Click:Connect(function() game.Workspace.Camera.CameraSubject = target end)
Thanks,
I would recommend making the target value the player of the character you wish to spectate. If this is what you are doing then copy below and paste.
local camera = workspace.CurrentCamera local target = script.Parent.Parent.TextBox.target script.Parent.MouseButton1Click:Connect(function() local char = target.Value.Character or workspace:FindFirstChild(target.Value.Name) if not char then return end local humanoid = char:FindFirstChildOfClass("Humanoid") if not humanoid then return end camera.CameraSubject = humanoid end)