I’ve been using Roblox’s player Camera for manipulating the mouselock/shiftlock offset and only recently have been facing an issue where, when not forking
PlayerModule:GetCameras() returns an empty table.
My current code for the actual offset manipulation looks something roughly like this
local CameraModule = require(Player.PlayerScripts:WaitForChild("PlayerModule")):GetCameras() local spring = Spring.new(Vector3.new()) -- Nevermore spring module, see https://quenty.github.io/NevermoreEngine/api/Spring/ spring.Speed = 10 local Offset = Instance.new("Vector3Value") Offset.Name = "CameraOffset" Offset.Parent = Player.PlayerScripts:WaitForChild("PlayerModule").CameraModule.MouseLockController Offset.Changed:Connect(function(newvalue) CameraModule.activeCameraController:SetMouseLockOffset(newvalue) end) game:GetService("RunService").RenderStepped:Connect(function(dt) --[[ Some code that manipulates the spring.Target value ]] Offset.Value = spring.Position end
I’m aware that at some point a year or two ago, Roblox has prevented/removed developer access at runtime to the player Camera module via an fflag (
FFlagUserRemoveTheCameraApi, see this), but up to this point I’ve been using this set of scripts to bypass that and up until now it HAS worked, and still seems to work in the Studio version of the Roblox player. However, it seems that either this week or last, an update has been pushed to the Roblox client that seems to render these scripts useless, returning the behavior back to returning an empty table when calling
Thus, my question is if anyone knows of a method of grabbing the Camera module that currently works on the Player client (as the solution I was using no longer works) without having to fork the entire PlayerModule, as having to go in and manually update it to make sure I get important/fixing changes to the module is inconvenient.
Alternatively, if no one knows of a method, is there some way of auto
magicallymatically grabbing the updated Player module for use in something like Rojo?
Getting this solved isn’t strictly important because if need be I will just update the PlayerModule manually, but I’d much prefer not having to do it. Any help on this is appreciated.
I have considered that it may be a matter of execution order (i.e. something requires
PlayerModule before the script is able to inject
FFlagUserRemoveTheCameraApi = false, but I’m not 100% about it.