I apologize if this question has been asked to death. I have done research on the matter, going from article to article. Most of the solutions given are outdated, no longer work, or are just too vague for me to understand.
I am creating a game which will lock players cameras into an over the shoulder, third person view, similar to the camera in the game Bad Business. After some research into the matter [reading the official roblox post on camera manipulation, as well as some posts on the dev forum], I decided I would force shift lock, as it's the "easiest way" [according to a random user on the forum] to create a third person camera. I found this post made in February of 2019: https://devforum.roblox.com/t/how-can-i-force-shift-lock/239206/12 and, for the most part, their recommendation works. The problem is the fact that shift-lock is NOT enabled by default. I have to manually press shift to enable it. After enable shift lock, it is permanently enabled. This problem was mentioned in the replies, however no solution was ever mentioned.
function CameraModule:OnMouseLockToggled()
if self.activeMouseLockController then
local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
if self.activeCameraController then
self.activeCameraController:SetIsMouseLocked(true)
self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
end
end
end
Above is the chunk of code I edited. More specifically, I added line 07 as required by the post
self.activeCameraController:SetIsMouseLocked(true)
The rest of the code can be found by playtesting a game, going into "StarterPlayer", "StarterPlayerScripts", then "PlayerModule", the script I edited is called "CameraModule", and the line I edited is line 542.
