of     1   

Lord_Oscar
#139916435Thursday, July 10, 2014 10:05 PM GMT

I want to have both my arms follow wherever my mouse points when I am in first person mode. I have been trying to do this for 2 days without any luck. Please help.
smiley599
#139916510Thursday, July 10, 2014 10:06 PM GMT

Look at some fre. models.
MHebes
#139918737Thursday, July 10, 2014 10:28 PM GMT

local dir = (MOUSE.Hit.p - (TORSO.Position + Vector3.new(1.5, 0.5, 0))).unit local angle = math.asin(-dir.y) SHOULDERWELD.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) -- maybe not necessary SHOULDERWELD.C1 = CFrame.new(-0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, math.pi/2, 0) That'd probably do it if you defined all the variables I capitalized for you and ran it on a loop
Lord_Oscar
#139920466Thursday, July 10, 2014 10:46 PM GMT

what is the variable for SHOULDERWELD?
Lord_Oscar
#139920666Thursday, July 10, 2014 10:48 PM GMT

Because i need both arms to follow the mouse
MHebes
#139921729Thursday, July 10, 2014 11:00 PM GMT

Then just do the bit with the SHOULDERWELD's twice, one for each shoulder. The variable is either the actual shoulder joint or a custom shoulder weld, if you don't want the arms to still move with walking and jumping and all that.
Lord_Oscar
#139922983Thursday, July 10, 2014 11:13 PM GMT

I have it in startergui as a local script and it doesn't work... What should I do?
MHebes
#139923477Thursday, July 10, 2014 11:18 PM GMT

What I posted is really just a framework so you can see the math... You have to implement it yourself - make sure you defined all the variables
Lord_Oscar
#139923715Thursday, July 10, 2014 11:21 PM GMT

i don't understand trig...
MHebes
#139924270Thursday, July 10, 2014 11:27 PM GMT

You don't have to, I gave all the math to you.
Lord_Oscar
#139926882Thursday, July 10, 2014 11:52 PM GMT

Can you at least tell me what I did wrong? local mouse = Game.Players.LocalPlayer:GetMouse() repeat wait() until Game.Players.LocalPlayer.Character local torso = Game.Players.LocalPlayer.Character:WaitForChild("Torso") local shoulderweld = Game.Players.LocalPlayer.Character.Torso:WaitForChild("Right Shoulder") local shoulderweld2 = Game.Players.LocalPlayer.Character.Torso:WaitForChild("Left Shoulder") i = 10 while 1 == 10 do local dir = (mouse.Hit.p - (torso.Position + Vector3.new(1.5, 0.5, 0))).unit local angle = math.asin(-dir.y) shoulderweld.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) -- maybe not necessary shoulderweld.C1 = CFrame.new(-0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, math.pi/2, 0) shoulderweld2.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) -- maybe not necessary shoulderweld2.C1 = CFrame.new(-0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, math.pi/2, 0) end
MHebes
#139928783Friday, July 11, 2014 12:11 AM GMT

while 1 == 10 do 1 never equals 10 silly. Also, there's no wait in that loop anyways. Also, I forgot that you needed to change the CFrames for the Left Shoulder. Here's the loop redone: while wait() do local dir = (mouse.Hit.p - (torso.Position + Vector3.new(1.5, 0.5, 0))).unit local angle = math.asin(-dir.y) shoulderweld.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) -- maybe not necessary shoulderweld.C1 = CFrame.new(-0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, math.pi/2, 0) shoulderweld2.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) -- maybe not necessary shoulderweld2.C1 = CFrame.new(0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, math.pi/2, 0) end The left arm may be backwards, no idea.
Lord_Oscar
#139933319Friday, July 11, 2014 12:54 AM GMT

i have it in startergui and nothing happens
MHebes
#139934856Friday, July 11, 2014 1:08 AM GMT

This works in StarterGui (Note: the arms will not go behind your head unless you/I put in a special case for it): local player = game.Players.LocalPlayer repeat wait() until player.Character local mouse = player:GetMouse() local torso = player.Character:WaitForChild("Torso") local right = torso:WaitForChild("Right Shoulder") local left = torso:WaitForChild("Left Shoulder") while wait() do local dir = (mouse.Hit.p - (torso.Position + Vector3.new(1.5, 0.5, 0))).unit local angle = math.asin(-dir.Y) right.C0 = CFrame.new(1, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0) right.C1 = CFrame.new(-0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, math.pi/2, 0) left.C0 = CFrame.new(-1, 0.5, 0, 0, 0, -1, 0, 1, 0, 1, 0, 0) left.C1 = CFrame.new(0.5,0.5,0) * CFrame.Angles(angle - math.pi/2, -math.pi/2, 0) end
Lord_Oscar
#139935765Friday, July 11, 2014 1:17 AM GMT

Now I start doing the worm and spasming on the ground because of the arms
MHebes
#139935997Friday, July 11, 2014 1:19 AM GMT

Not in my solo test :P
Lord_Oscar
#139936118Friday, July 11, 2014 1:21 AM GMT

hbu come to my game to test it out and see what happens
Lord_Oscar
#139937157Friday, July 11, 2014 1:32 AM GMT

it still doesn't work after not moving the left shoulder... i seriously need help
Jetta765214
#139938274Friday, July 11, 2014 1:44 AM GMT

local player = game.Players.LocalPlayer local mouse = player:GetMouse() repeat wait() until player.Character local character = player.Character local torso = character.Torso local ls = torso['Left Shoulder'] local rs = torso['Right Shoulder'] while true do wait() local cframe = CFrame.new(torso.Position,mouse.Hit.p) local cframe = cframe:inverse()*torso.CFrame local cframe = cframe-cframe.p ls.C0 = cframe:inverse()*CFrame.Angles(math.pi/2,0,0) rs.C0 = cframe:inverse()*CFrame.Angles(math.pi/2,0,0) end This is technically what you requested. Edit it to your needs. (No trigonometry needed) Alt. of Jetta765214
Lord_Oscar
#139977794Friday, July 11, 2014 12:00 PM GMT

this puts my arms in the middle of my body and it spasms
jacklollz2
#139978404Friday, July 11, 2014 12:14 PM GMT

wiki.roblox.com You seem to lack common intelligence, please just search around the wiki for scripting tutorials. Roblox scripting is not a thing you can do in 2 minutes and expect something amazing happening for beginners.

    of     1