I wanna make a part that, if the player touch it, the player's CameraMode will lock in ThirdPerson.
I tried this with local script, but didn't work:
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then if game.Players:FindFirstChild(hit.Parent.Name) then local player = game.Players:FindFirstChild(hit.Parent.Name) player.CameraMode = "LockThirdPerson" end end end)
Thanking you in advance
I assume by this you want to the camera to be locked in place without a zoom. You will want to change the ZoomDistance values.
local Players = game:GetService('Players') local zoomDistance = 10 -- change this to how close or far you want to the camera to be script.Parent.Touched:Connect(function(hit) local Player = Players:GetPlayerFromCharacter(hit.Parent) if Player then Player.CameraMode = Enum.CameraMode.Classic -- just incase you have first person lock Player.CameraMaxZoomDistance = zoomDistance Player.CameraMinZoomDistance = zoomDistance end -- wanna check if it's a player end) -- onTouched