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

Making a locked custom 3rd person camera?

Asked by
aiuis 85
7 years ago

What I've gotten so far:

Local Lock=false

game:GetService'UserInputService'.InputBegan:Connect(function(Input)
    if Input.KeyCode==Enum.KeyCode.Q then
        if Lock==false then
            Lock=true
        else
            Lock=false
        end
    end
end)

while wait()do
    if Lock==true then
        game:GetService'UserInputService'.MouseBehavior=Enum.MouseBehavior.LockCenter
    end
end

This does the half job - it locks the camera and centers the cursor. However it requires right click to rotate the camera which I'd want to rotate just by moving the mouse itself. I'm not the best when it comes to math and camera manipulation is new for me but I want to learn. I've seen a few people bringing up this question but none were answered correctly so I need your help plox!

1 answer

Log in to vote
0
Answered by 7 years ago

get the mouse's Delta X and Delta Y values and rotate it with those values

Ad

Answer this question