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

How do you point an arm towards the mouse? [closed]

Asked by
Bisoph 5
6 years ago
Edited 6 years ago

I'm making a paintball game, and when I played it with my friend, he suggested to make it an FPS. So, I tried to make an FPS mode, but I'm having trouble with one thing: how do you make your arm point towards the mouse? I looked in the Urist's pistol model, but I don't get it. What is a simple way to make the right arm point towards the mouse?

When I tried it, the arm pointed in the wrong direction. I used this code:

tool.Equipped:Connect(function(mouse)
    local char = tool.Parent
    local joint = char.Torso['Right Shoulder']
    while tool.Parent == char do
        wait()
        joint.C0 = CFrame.new(joint.C0.p, mouse.hit.p)
    end
end)

I tried copying the code from the pistol model. It did work, but at one point it deleted my character,

Closed as Not Constructive by OldPalHappy

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?