Hello, I am working on a musket (Tool) and I want the musket and the arms to follow the mouse when the CurrentAnim = “Present”, I use a FakeHandle in my tool to weld my musket and a Motor6D inside HumanoidRootPart, the Part0 is the Parent (HumanoidRootPart) and the Part1 is the FakeHandle of the weapon.
I did make the musket and the arms to follow the mouse but there’s a slight problem when the mouse hovers up or down the musket collides with the arms. Here’s the GIF:
https://gyazo.com/4ef9071bae9b96f74620f1bc24229c8d
Here’s an example of what I am trying to achieve:
https://gyazo.com/6290a7811a9f7fb2d333e5a73ec3ad19
Here’s the script that makes the tool and the arms follow the mouse:
RenderService.RenderStepped:Connect(function()
if CurrentAnim == "Present" then
if Playing == false then
if Equipped == true then
local RightShoulder, LeftShoulder, ToolGrip = character.Torso["Right Shoulder"], character.Torso["Left Shoulder"], character.HumanoidRootPart:WaitForChild("BrownBess")
local X = -(math.asin((mouse.Origin.p - mouse.Hit.p).unit.y))
local _, Y, Z = RightShoulder.C0:ToEulerAnglesXYZ()
local OldRightC0 = RightShoulder.C0
RightShoulder.C0 = CFrame.new(RightShoulder.C0.Position) * CFrame.Angles(X, Y, Z)
local Difference = OldRightC0.Position - RightShoulder.C0.Position
local _, Y, Z = ToolGrip.C0:ToEulerAnglesXYZ()
ToolGrip.C0 = CFrame.new(ToolGrip.C0.Position) * CFrame.Angles(X, Y, Z)
local _, Y, Z = LeftShoulder.C0:ToEulerAnglesXYZ()
LeftShoulder.C0 = CFrame.new(LeftShoulder.C0.Position) * CFrame.Angles(X, Y, Z)
end
end
end
end)
Thank you.