I'm trying to make a script that when the player walks through the door it changes their angle of view and etc. The first script is the "CameraChange" and the second one is in the door.
local offset = Vector3.new(50,10,0) local fieldOfView = 100 local player = script.Parent.Parent local camera = game.Workspace.CurrentCamera local runService = game:GetService("RunService") camera.FieldOfView = fieldOfView local function onRenderStep() local playerPosition = player.Character.HumanoidRootPart.Position local cameraPosition = playerPosition + offset camera.CoordinateFrame = CFrame.new(cameraPosition, playerPosition) end runService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onRenderStep)
script.Parent.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") ~= nil then local NewCam = game.Players:GetPlayerFromCharacter(hit.Parent).StarterPlayer.StarterPlayerScripts:WaitForChild("CameraChange") NewCam.Disabled = false end