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

How do the hands work?

Asked by
samsaq 0
9 years ago

How do the swaying/gun holding hands in games like phantom forces work and how are they programed, for I would like to mess around with them for a game idea I have.

1 answer

Log in to vote
0
Answered by 9 years ago

I'm actually working on the same thing, start with welding arms, I have some example code below. You use CFrame(0,0,0) * CFrame.Angles or * fromEulerAnglesXYZ(0,0,0) <-- both are the same. Basically you are welding the arms to new positions. I have yet to find out about how to make the arms sway... but start off with this!

function Equipped()
    local RArmWeld = Instance.new("Weld")
    RArmWeld.Name = "RArmWeld"
    RArmWeld.Parent = Character
    RArmWeld.Part0 = RArm
    RArmWeld.Part1 = HumRootPart
    RArmWeld.C0 = CFrame.new(-0.75, -0.4, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)

    local LArmWeld = Instance.new("Weld")
    LArmWeld.Name = "LArmWeld"
    LArmWeld.Parent = Character
    LArmWeld.Part0 = LArm
    LArmWeld.Part1 = HumRootPart
    LArmWeld.C0 = CFrame.new(-0.35, 1.4, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
end
Ad

Answer this question