I wanted to set a camera that is behind the character (like third person shooter camera) And it worked... kinda. The character movement isnt smooth and so is the camera. Please help if i miss something in the script.
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Scriptable" local target = game.Players.LocalPlayer.Character.Humanoid.Torso local camera = workspace.CurrentCamera while wait() do camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.new(2, 2, 3) end
It seems as you're using a while loop which is not fast enough to update on time. Try using the RunService to run that loop every render step or every frame like this:
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid game.Workspace.CurrentCamera.CameraType = "Scriptable" local target = game.Players.LocalPlayer.Character.Humanoid.Torso local camera = workspace.CurrentCamera game:GetService("RunService").RenderStepped:Connect(function() camera.CoordinateFrame = CFrame.new(target.Position) * CFrame.new(2, 2, 3) end)