Hello,
I’ve been having issues with the Motor6D.C0 value with my new gun script.
Anytime I move, the gun bobbles up and down.
Example: 2021-12-26 00-32-20.mp4 - Google Drive
Here’s an example of my code:
local RightShoulder = char.Torso:WaitForChild("Right Shoulder")
local Neck = char.Torso:WaitForChild("Neck")
local X = -(math.asin((mouse.Origin.p - mouse.Hit.p).unit.y))
local _, Y, Z = RightShoulder.C0:ToEulerAnglesXYZ()
RightShoulder.C0 = CFrame.new(RightShoulder.C0.Position) * CFrame.Angles(X+math.pi/4, Y, Z+math.pi/4)
Neck.C0 = CFrame.new(Neck.C0.Position) * CFrame.Angles(X+math.pi/2, Y+math.pi/2, Z)