I have tried getting the character move direction and change the camera position.
This code is in StarterCharacterScripts(folder)
--Code
local currentCam = game.Workspace.CurrentCamera local camPart = game.Workspace.Cam local player = game.Players.LocalPlayer local character = player.Character currentCam.CameraType = Enum.CameraType.Scriptable repeat wait() print("FIXING") currentCam.CameraType = Enum.CameraType.Scriptable until currentCam.CameraType == Enum.CameraType.Scriptable print("FIXED") currentCam.CFrame = camPart.CFrame while wait(0.1) do currentCam.CFrame = camPart.CFrame if character.Humanoid.MoveDirection == Vector3.new(1, 0, 0) then camPart.Position = character.HumanoidRootPart.Position + Vector3.new(1, 0, 0) end end
--i have solved this myself
local currentCam = game.Workspace.CurrentCamera local camPart = game.Workspace.Cam local player = game.Players.LocalPlayer local character = player.Character currentCam.CameraType = Enum.CameraType.Scriptable repeat wait() print("FIXING") currentCam.CameraType = Enum.CameraType.Scriptable until currentCam.CameraType == Enum.CameraType.Scriptable print("FIXED") currentCam.CFrame = camPart.CFrame
while wait() do currentCam.CFrame = camPart.CFrame camPart.Position = character.Head.Position + Vector3.new(0, 0, 20) end