Not sure why this is happening but im changing the camera’s CFrame and after a while it just stops the character from walking at all
i can only jump nothing else
Heres the code
local function Main()
local Character = player.Character or player.CharacterAdded:Wait()
local rp = Character:WaitForChild("HumanoidRootPart")
Connection1 = RunService.Heartbeat:Connect(function()
local tH = (clamp(View,MinView,MaxView))/5
local mP = mouse.Hit.Position
local tP = (rp.Position + mP) / 2
local xClamp = clamp(tP.X, -tH + rp.Position.X, tH + rp.Position.X)
local zClamp = clamp(tP.Z, -tH + rp.Position.Z, tH + rp.Position.Z)
local CamCFrame = cfn(xClamp, rp.Position.Y + clamp(View, MinView, MaxView), zClamp) * DownCF
if Debug then
part1.Position = mP
part2.Position = tP
part3.Position = CamCFrame.Position - v3n(0, clamp(View, MinView, MaxView), 0)
end
rp.CFrame = CFrame.lookAt(rp.Position, v3n(mP.X, rp.Position.Y, mP.Z))
Ts:Create(camera, TweenInfo.new(.2, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),{CFrame = CamCFrame}):Play()
end)
end
(edit2)
Figured out its something about multiplying the cframe with the downCF (just makes the camera look down) but im not sure why, or a alternative to it
Its something with facing the camera down. nothing else i have no clue why but it just stops the character from moving most of the time