Force Shiftlock Help

So I am making a gun game that will be in 3rd person similar to fortnite
I do not know how to force shiftlock in the game

Every post I have found pointed to the same script which is pretty rough and not smooth at all

I do not mind if it changes the playermodule, I just want it to be easily enabled and disabled through a script

EDIT: the camera is not the issue because of the CameraOffset property, the issue is making the character look at the mouse

Here’s an editted PlayerModule so you can enable/disable mouse lock at any time (just realized you needed disabling and enabling functionality)

PlayerModuleMouseLockEdition.rbxm (142.0 KB)

To enable MouseLock, do this:

local PlayerModule = require(LocalPlayer.PlayerScripts.PlayerModule)
local cameras = PlayerModule:GetCameras()

-- sets the mouse lock active
cameras:SetMouseLockActive(true)

-- sets the mouse lock inactive
cameras:SetMouseLockActive(false)

This also works on mobile devices.

Example:

https://gyazo.com/360a3c7e418c7f899efdc1f09b780c7b

1 Like

you do not realize the amount of pain i have been through to find this :sob: tysm

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.