I’m attempting to lock the mouse to the center of the screen. For some unknown reason, setting the .MouseBehavior of the player’s UserInputService seems to be over-ridden somehow. Code:
--note: this code executes after ample loading time is provided for the player
local UIS = game:GetService('UserInputService')
local RunService = game:GetService('RunService')
RunService:BindToRenderStep('mouseLock',100000,function()
print(UIS.MouseBehavior)
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
print(UIS.MouseBehavior)
end)
The output alternates between ‘Enum.MouseBehavior.Default’ and ‘Enum.MouseBehavior.LockCenter’. This leads me to believe that UserInputService’s .MouseBehavior is being changed, but something is over-riding the property back to ‘Enum.MouseBehavior.Default’. Any insight OR better practice methods is appreciated!