I have a LocalScript in StarterCharacterScript that affects the player’s camera whenever he touches a part. The problem is that when a player touches a part other player’s cameras also change. I want to make it so that only the player that touches the part has his camera changed. Here is the script:
local door = game.Workspace.finalisland.door
local cam = game.Workspace.CurrentCamera
local player = game.Players.LocalPlayer
door.Touched:Connect(function(plr)
cam.Focus = game.Workspace.finalisland.cam1focus.CFrame
cam.CameraType = "Scriptable"
cam.CFrame = game.Workspace.finalisland.cam1.CFrame
end)
game.Workspace.finalisland.cam2trigger.Touched:Connect(function(plr)
cam.Focus = game.Workspace.finalisland.cam1focus.CFrame
cam.CameraType = "Scriptable"
cam.CFrame = game.Workspace.finalisland.cam2.CFrame
end)
door.Parent.doorbefore.Touched:Connect(function(plr)
cam.CameraType = "Custom"
cam.CameraSubject = player.Character:FindFirstChild("Humanoid")
end)
game.Workspace.finalisland.cam2triggerbefore.Touched:Connect(function(plr)
cam.Focus = game.Workspace.finalisland.cam1focus.CFrame
cam.CameraType = "Scriptable"
cam.CFrame = game.Workspace.finalisland.cam1.CFrame
end)