Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with adjusting my limbs-face-mouse script?

Asked by 7 years ago
Edited 7 years ago

This script works perfectly well. It's just that the arms go inside of the camera when I look up when the arms are extended in front of me. When I use my gun sights, it moves up and I'm not aiming correctly anymore. I just need some way of keeping the arms in the same offset as the camera, if that makes sense.

Here is what I don't want: http://imgur.com/a/VOfyT ---|--- http://imgur.com/a/yMrDJ

Here is what I DO want: http://imgur.com/a/x98le ---|--- http://imgur.com/a/xqSc4

script.Parent.HeadMouseFollow.OnServerEvent:connect(function(plr, chr, origin, hitpos)
    if chr.Torso:FindFirstChild("Right Shoulder") then
        chr.Torso:WaitForChild("Right Shoulder").C0 = CFrame.new(1,0.5,0) * CFrame.Angles(-math.asin((origin - hitpos).unit.y),1.55,0)
    end
    if chr.Torso:FindFirstChild("Left Shoulder") then
        chr.Torso:WaitForChild("Left Shoulder").C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(-math.asin((origin - hitpos).unit.y),-1.55,0)
    end
    if chr.Torso:FindFirstChild("Neck") then
        chr.Torso:WaitForChild("Neck").C0 = CFrame.new(0,1,0) * CFrame.Angles(-math.asin((origin - hitpos).unit.y) + 1.55,3.15,0)
    end
end)
0
And if I were to weld my arms to the head, the animations used in the gun scripts wouldn't work anymore. laughablehaha 494 — 7y

Answer this question