Over Shoulder Camera

So I’m working on a weapons system and it needs an Over shoulder cam and I can’t get it to work on mobile, It works on like pc but when you go on a mobile device or the mobile emulator on studio it won’t let me move the cam around. Here are some

PC/What it’s supposed to look like on mobile:
Gifsezgif.com-gif-maker

Mobile/What it’s not supposed to do:
ezgif.com-gif-maker copy

Source Code:

local uis = game:GetService("UserInputService")


local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable


local char = script.Parent

local humanoid = char:WaitForChild("Humanoid")
humanoid.AutoRotate = false

local hrp = char:WaitForChild("HumanoidRootPart")


local x = 0
local y = 0


local offset = Vector3.new(3, 3, 10)


uis.InputChanged:Connect(function(input, processed)
    
    if processed then return end
    
    if input.UserInputType == Enum.UserInputType.MouseMovement then
        
        x = x - input.Delta.X
        
        y = math.clamp(y - input.Delta.Y*0.4, -75, 75)
        
        
        hrp.CFrame = hrp.CFrame * CFrame.Angles(0, math.rad(-input.Delta.X), 0)
    end
end)


game:GetService("RunService").RenderStepped:Connect(function()
    
    uis.MouseBehavior = Enum.MouseBehavior.LockCenter
    
    
    local startCFrame = CFrame.new((hrp.CFrame.Position)) * CFrame.Angles(0, math.rad(x), 0) * CFrame.Angles(math.rad(y), 0, 0)
    local cameraCFrame = startCFrame:ToWorldSpace(CFrame.new(offset.X, offset.Y, offset.Z))
    local cameraDirection = startCFrame:ToWorldSpace(CFrame.new(offset.X, offset.Y, -10000))
    
    camera.CFrame = CFrame.new(cameraCFrame.Position, cameraDirection.Position)
end)

KEEP IN MIND THIS IS NOT MY SOURCE IT IS THE CODE THAT WAS USED TO DEMO THIS