i dont know much about motor6d, and i need help
i want to make a dynamic animation of a weapon following the cursor, so i used a script from How would I make a players arm move depending on the y axis of the mouse? (R6) - #8 by ToxicalGamer2006, but when i implemented it into the weapon, i encountered a bug where because of the animated torso, arms become more arched the farther away you from the center
as i said, i dont know much about motor6d, but i tried playing around with values and tried using RootJoint.Transform but it had no result whatsoever
-- game:GetService("RunService").RenderStepped:Connect(function()
print(char.HumanoidRootPart["RootJoint"].Transform)
--[[HumanoidRootPart Movement]]--
if IsEquipped == true then
--char.HumanoidRootPart.CFrame = CFrame.new(char.HumanoidRootPart.CFrame.Position, Vector3.new(m.Hit.p.X, char.HumanoidRootPart.CFrame.Position.Y, m.Hit.p.Z))
end
--[[Arms and Head Movement]]--
if IsEquipped and AnimateArms.Value then
if AnimateArms.Value then
if char.Torso:FindFirstChild("Right Shoulder") then
char.Torso["Right Shoulder"].C0 = char.Torso["Right Shoulder"].C0:Lerp(CFrame.new(1, .65, 0) * CFrame.Angles(math.asin((m.Hit.Position - m.Origin.Position).Unit.Y), 1.55, 0, 0) , 0.8)
end
if char.Torso:FindFirstChild("Left Shoulder") then
char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0:Lerp(CFrame.new(-1, .65, 0) * CFrame.Angles(math.asin((m.Hit.Position - m.Origin.Position).Unit.Y), -1.55, 0, 0) , 0.8)
end
if char.Torso:FindFirstChild("Neck") then
char.Torso["Neck"].C0 = char.Torso["Neck"].C0:Lerp(CFrame.new(0, 1, 0) * CFrame.Angles(math.asin((m.Hit.Position - m.Origin.Position).Unit.Y) + 1.55, 3.15, 0), 1)
end
end
else
if not char:FindFirstChild("Torso") then return end
if char.Torso:FindFirstChild("Right Shoulder") then
char.Torso["Right Shoulder"].C0 = char.Torso["Right Shoulder"].C0:lerp(origRightS, 0.1)
end
if char.Torso:FindFirstChild("Left Shoulder") then
char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0:lerp(origLeftS, 0.1)
end
if char.Torso:FindFirstChild("Neck") then
char.Torso["Neck"].C0 = char.Torso["Neck"].C0:lerp(origNeck, 0.1)
end
end
end)
This is how it looks right now:
this one is with the torso animation, its bugged and arching
this is the old version without torso animation:
this is the result i desire, but with the torso animation
is there any way to take the torso animation into account when calculating C0?