I wanna change the local player camera pos to a set part on my workspace when the player hits the part, I managed to write the script below, which works, but instead of changing only the local player camera pos, it changes all players camera position instead. How can I make it only changes the local player camera?
local camera = workspace.CurrentCamera
local part = workspace.cam
workspace.Test.Touched:Connect(function(hit)
if game.Players:GetPlayerFromCharacter(hit.Parent)then
camera.CameraType = Enum.CameraType.Scriptable
camera.CFrame = part.CFrame
end
end)
The script is local and is storaged under StarterPlayer/StarterPlayerScripts

3 comments
What if his camera is named cam in the workspace
No
"cam" is the part which I use to set the camera's new position