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

How would I lock the mouse?

Asked by
Zyrup 27
7 years ago
Edited 7 years ago

How would I lock the mouse in third person, as if the player was constantly holding the right mouse button. I understand scripting helpers isn't a request site, however, I am not asking for 2,000 lines. I just need to be educated.

I'll provide some context though; https://gyazo.com/d43f0625926f223ac39beb28e1472121 It's for my GTA style aiming system.

1 answer

Log in to vote
1
Answered by
FiredDusk 1466 Moderation Voter
7 years ago

So make this in a local script:

--Define the player and other things, if you need.
local UserInputService= game:GetService("UserInputService") --Gets the service, of course
UserInputService.MouseBehavior = Enum.MouseBehavior.LockCenter --Changes 'MouseBehavior'.

I am not too good at explaining, sorry. Hope this helps!

0
You're a lifesaver bud! Zyrup 27 — 7y
0
;) FiredDusk 1466 — 7y
Ad

Answer this question