Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making a locked custom 3rd person camera?

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

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

This discussion is preserved as it was. New answers, comments, and votes are closed.