So at certain point of a game I wanna make the player have like shift lock on while he doesn’t, making his character move same direction as the camera while I know how to do this from editing the camera module I wanna see if I can activate it manually from any point through the game. Heres the code inside of the CameraModule I wanna activate
function CameraModule:Update(dt)
if self.activeCameraController then
if FFlagUserCameraToggle then
self.activeCameraController:UpdateMouseBehavior()
end
local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)
self.activeCameraController:ApplyVRTransform()
if self.activeOcclusionModule then
newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
end
-- Here is where the new CFrame and Focus are set for this render frame
game.Workspace.CurrentCamera.CFrame = newCameraCFrame
game.Workspace.CurrentCamera.Focus = newCameraFocus
-- Update to character local transparency as needed based on camera-to-subject distance
if self.activeTransparencyController then
self.activeTransparencyController:Update()
end
if FFlagUserCameraInputRefactor and CameraInput.getInputEnabled() then
CameraInput.resetInputForFrameEnd()
end
end
self.activeCameraController:SetIsMouseLocked(true)
end