im trying to change my arm’s rotation through code. i have a picture of the sniper animation idle that i made and i want to rotate the arm 90 degrees / rad from where my animation is positioned / rotated if that makes sense. i appreciate any help tysm!!
script:
function module.rotateArmsFunction(p:Player)
local c = p.Character
local bpTable = {
Head = c:WaitForChild("Head"),
RightHand = c:WaitForChild("RightHand"),
LeftHand = c:WaitForChild("LeftHand"),
LowerTorso = c:WaitForChild("LowerTorso"),
RightLowerArm = c:WaitForChild("RightLowerArm"),
LeftUpperArm = c:WaitForChild("LeftUpperArm"),
LeftLowerArm = c:WaitForChild("LeftLowerArm"),
RightUpperArm = c:WaitForChild("RightUpperArm"),
UpperTorso = c:WaitForChild("UpperTorso"),
RightShoulder = c:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder");
LeftShoulder = c:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder");
RightElbow = c:WaitForChild("RightLowerArm"):WaitForChild("RightElbow");
LeftElbow = c:WaitForChild("LeftLowerArm"):WaitForChild("LeftElbow")
}
bpTable.RightShoulder.Transform = CFrame.new(bpTable.RightShoulder.C0.Position) * CFrame.Angles(math.rad(90),0,0)
end
right so i got it after reading some posts. this is the solution for anyone else:
function module.rotateArmsFunction(p:Player)
local c = p.Character
local bpTable = {
Head = c:WaitForChild("Head"),
RightHand = c:WaitForChild("RightHand"),
LeftHand = c:WaitForChild("LeftHand"),
LowerTorso = c:WaitForChild("LowerTorso"),
RightLowerArm = c:WaitForChild("RightLowerArm"),
LeftUpperArm = c:WaitForChild("LeftUpperArm"),
LeftLowerArm = c:WaitForChild("LeftLowerArm"),
RightUpperArm = c:WaitForChild("RightUpperArm"),
UpperTorso = c:WaitForChild("UpperTorso"),
RightShoulder = c:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder");
LeftShoulder = c:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder");
RightElbow = c:WaitForChild("RightLowerArm"):WaitForChild("RightElbow");
LeftElbow = c:WaitForChild("LeftLowerArm"):WaitForChild("LeftElbow")
}
bpTable.RightShoulder.C0 = CFrame.new(bpTable.RightShoulder.C0.Position) * CFrame.Angles(math.rad(90),0,0)
end
extra:
i had to set the animation priority for my animation to idle bc my animations rotation was overriding the rotation i wanted (to rotate the arm 90 degrees past my animations initial rotation)