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

How would I make a player's right arm point in the direction of the player's mouse?

Asked by
Avectus 120
10 years ago

I'm not sure how to start this either.

1 answer

Log in to vote
1
Answered by 10 years ago

You can use the CFrame.new(Vector3,Vector3) constructor to make a CFrame whose position is at the first Vector3 argument, whose lookVector aims from its position towards the second Vector3 argument.

01rightshoulder.C1=CFrame.new(0,0,0.5)*CFrame.Angles(-math.pi/2,0,0)
02while true do
03    wait()
04    rightshoulder.C0=CFrame.new(Vector3.new(1.5,0.5,0),Torso.CFrame:inverse()*aimat)
05end
06--[[Where
07aimat is the position of the Player's mouse.
08Vector3.new(1.5,0.5,0) is the position of the Player's shoulder
09Torso.CFrame:inverse()*aimat is the relative position of the aimat point
10]]
Ad

Answer this question