I’ve used dependency injection to modify the camera module dynamically from a different script in StarterPlayerScripts (so it only runs once) in order to allow for scriptable adjustments to look speed and custom look speed on mobile. Here are the relevant parts:
local GetSetting = game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerSettings"):WaitForChild("GetSetting")
local BaseCamera = require(script.Parent.PlayerModule.CameraModule.BaseCamera)
local InputTranslationToCameraAngleChangeBase = BaseCamera.InputTranslationToCameraAngleChange
function BaseCamera:InputTranslationToCameraAngleChange(translationVector, sensitivity)
local result =sensitivity
* (_G.MouseSensitivity or 1)
* (UIS:GetLastInputType() == Enum.UserInputType.Touch and Vector2.new(GetSetting:Invoke("TouchSensitivity"), GetSetting:Invoke("TouchSensitivityVertical")) or 1)
return InputTranslationToCameraAngleChangeBase(self, translationVector,result)
end
This is the only place in the game where I adjust camera location or change the camera script at all.
The issue I’m having is on mobile only, and not in the Studio mobile emulator, where seemingly at random the camera will spin around uncontrollably when you first put your finger down. I’ve worked out that the sensitivity parameter is fine, _G.MouseSensitivity is constrained elsewhere to between 0 and 1, TouchSensitivity and TouchSensitivityVertical are similarly constrained between .1 and 10, and generally do not change within the same life.