I am currently trying to make a system in which a User carries a box just as any human would carry a large package: with two hands.
I animated this rig in animation editor, and I would like the arms to be positioned exactly that way. However, I am unaware of the best way to accomplish this. I’ve made a script that vaguely emulates what I want, but it’s definitely not perfect. It uses welds to position every part of the arm relative to the other parts. This example only demonstrates my script for one hand, but I want both hands to be positioned differently.
This is my current script:
local offset = plr.Character.UpperTorso.CFrame:Inverse() * plr.Character.LeftUpperArm.CFrame
local offset1 = plr.Character.LeftUpperArm.CFrame:Inverse() * plr.Character.LeftLowerArm.CFrame
local offset2 = plr.Character.LeftLowerArm.CFrame:Inverse() * plr.Character.LeftHand.CFrame
local weld = Instance.new("Weld", plr.Character.LeftUpperArm)
weld.Part0 = plr.Character.UpperTorso
weld.Part1 = plr.Character.LeftUpperArm
weld.C0 = offset*CFrame.new(0,0,-0.5)*CFrame.Angles(math.pi/2,0,math.pi/30)
local weld = Instance.new("Weld", plr.Character.LeftUpperArm)
weld.Part0 = plr.Character.LeftUpperArm
weld.Part1 = plr.Character.LeftLowerArm
weld.C0 = offset1
local weld = Instance.new("Weld", plr.Character.LeftLowerArm)
weld.Part0 = plr.Character.LeftLowerArm
weld.Part1 = plr.Character.LeftHand
weld.C0 = offset2
I also tried to animate the player’s arms up and then freeze them there at the end of the animation, but I have been unsuccessful. As this arm positioning will be at the end of an animation, this solution would have been ideal, but obviously it doesn’t work.
P.S. I used welds instead of joints because I want the arms to stay in place as the player moves.