![]() ![]() ![]() ![]() Game:GetService("UserInputService").MouseBehavior = -Set the mouse to center every frame.Īfter we centered the mouse, we now want the camera to be a bit above and right from the character, like the Shift-Lock effect.įor this, we use Humanoid.CameraOffset. Game:GetService("RunService"):BindToRenderStep("ShiftLock",, function() If active then -Whether to enable or disable Local plr = game:GetService("Players").LocalPlayerįunction shiftLock(active) -Toggle shift lock function Local script that centers mouse: -Local script in StarterPlayerCharacter We RunService.RenderStepped to center it on every frame so it won’t revert back to normal. Let’s start writing the script, the following script will center the mouse. I prefer to put it in StarterCharacterScripts Since it’s easier to reference the character, but you can do this in every place where local scripts can run, just reference the Character accordingly. RunService.RenderStepped / RunService.PreRenderįirstly, since we use MouseBehavior (A UserInputService “client” property), we use a LocalScript and not a script. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |