I've made a camera script, so that when you click a part it sends a signal to client to change your camera to view a part. (Security Cameras Basically) And when you click again you're returned to your Avatar. However, when I do this the player model doesn't turn transparent in 1st person, and you can move your camera through walls. Advice is greatly appreciated!
-- This is in a LOCAL Script
local RepS = game:GetService("ReplicatedStorage")
local Remote = RepS.Remote
local CameraEvent = Remote.CEvent
local ViewingCharacter = true
local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
CameraEvent.OnClientEvent:connect(function(Camera)
local Cam = workspace.CurrentCamera
local Character = workspace[Player.Name]
Cam.CameraSubject = Camera
Cam.CameraType = Enum.CameraType.Custom
ViewingCharacter = false
local ActiveCamera = function()
if ViewingCharacter then return end
if not Character:FindFirstChild("Head") then return end
Cam.CameraSubject = Character.Head
Cam.CameraType = Enum.CameraType.Custom
ViewingCharacter = true
end
Mouse.Button1Down:connect(ActiveCamera)
end)

3 comments
The camera subject for default is actually the humanoid.
^ CameraSubject = Character.Humanoid
Thanks!