Trying to make the gun aim towards the camera, but it is overriden by my custum gun idle animation

I have made a script to make my arm follow the mouse. However if i equip my gun, the aiming animation overrides my arm follow. Here is the script that i use:

local RunService = game:GetService("RunService")

local Player = game.Players.LocalPlayer
local Mouse = Player:GetMouse()
local Camera = workspace.CurrentCamera

local Character = Player.Character or Player.CharacterAdded:Wait()
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

local RightUpperArm = Character:WaitForChild("RightUpperArm")
local Shoulder = RightUpperArm:WaitForChild("RightShoulder")
local ShoulderOriginC0 = Shoulder.C0




RunService.RenderStepped:Connect(function()
		local rightX, rightY, rightZ = Shoulder.C0:ToEulerAnglesYXZ()
		Shoulder.C0 = (Shoulder.C0 * CFrame.Angles(-rightX, 0, 0) * CFrame.Angles(math.asin((Mouse.Hit.p - Mouse.Origin.p).unit.y),0,0))
	end)

Video describing issue:
robloxapp-20221002-0841179.wmv (1.9 MB)

Nvm I figured it out. All i had to do was make a separate Motor6d for the hand.