I'm trying to keep my mouse centered on the screen so I can make a third person view in my game. This doesn't work but yeah :P
mouse.Changed:connect(function()
mouse.Y = 0
mouse.X = 0
end)
I'm trying to keep my mouse centered on the screen so I can make a third person view in my game. This doesn't work but yeah :P
mouse.Changed:connect(function()
mouse.Y = 0
mouse.X = 0
end)
You can use UserInputService to do this:
game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
There's actually a built-in way to get the players mouse, you'd need to make a local script and put it in StarterPack or StarterGui :
local Player = script.Parent.Parent
local mouse = Player:GetMouse()
function CenteredMouse()
-- Code
end
-- Call the function
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
I've already got the Player and Mouse thing done