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

1 comment
Also if you have the answer can you explain to me(It would be helpful for me in the future)