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
9 years ago

I'm not sure how to start this either.

1 answer

Log in to vote
1
Answered by 9 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.

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

Answer this question