-
What do you want to achieve? Keep it simple and clear!
I want to be able to lock and unlock the mouse in game. -
What is the issue? Include screenshots / videos if possible!
I have written the lock and unlock mouse code, but it seems to not work as I was expecting. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried inputBegan and RenderStepped as it is supposed to be used, however both of them don’t work even inputBegan. I have tried looking for similar topics but they’re not exactly what I wanted.
This is the code:
runService.RenderStepped:Connect(function()
if viewMode == 1 or 3 then
UIS.MouseBehavior = Enum.MouseBehavior.LockCenter
else
UIS.MouseBehavior = Enum.MouseBehavior.Default
end
end)