For some reason whenever the character dies it doesn't look back at the character again even after death even though it updates every frame. Also when the character falls and the model is destroyed then it gives an error saying 'Torso is not a valid member of model' even though I added an if statement.
Heres the script:
-- Scripted by ThePhantomDeveloper
local runService = game:GetService('RunService')
local zOffset = 20
local yOffset = 5
local player = game.Players.LocalPlayer
local character = player.Character
local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable
function onUpdate()
if player and character and character.Torso then
camera:Interpolate(CFrame.new(Vector3.new(character.Torso.Position.X, character.Torso.Position.Y + yOffset, character.Torso.Position.Z + zOffset)), CFrame.new(character.Torso.Position), 0.25)
end
end
runService:BindToRenderStep('Camera', Enum.RenderPriority.Camera.Value, onUpdate)
