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

How do i have the arms of an r-15 player follow the mouse?

Asked by
wookey12 174
6 years ago

i am making a script where the arms on an r-15 player move up and down with the mouse. it works, but the arms spin around super fast. i am using mouse.X to have it move with the mouse. this is a snippet of code, so that's why i have 6 values in the table instead of just 2. this is located in starterpack

local Player = script.Parent.Parent
local Char = Player.Character
local Table = {Char.LeftHand, Char.RightHand, Char.LeftLowerArm, Char.RightLowerArm, Char.LeftUpperArm, Char.RightUpperArm}

local mouse = Player:GetMouse()

mouse.Move:connect(function()
Table[5].LeftShoulder.C0 = Table[5].LeftShoulder.C0 * CFrame.Angles(math.rad(-mouse.X + 50), math.rad(0), math.rad(0))
Table[6].RightShoulder.C0 = Table[6].RightShoulder.C0 * CFrame.Angles(math.rad(mouse.X - 50), math.rad(0), math.rad(0))
end)

Answer this question