Recent Issue with Player Camera Module?

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, 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 PlayerModule:GetCameras().

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 automagicallymatically 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.

1 Like

So update on this; from this point on you physically cannot access the Camera module without forking it.
For anyone who can’t be bothered to traverse the commit (though the changes relevant to the Camera are just at the bottom so you can just scroll down there very quickly), they removed the check for FFlagUserRemoveTheCameraApi and literally just return an empty table when requiring the module.

I only noticed this because I was looking into how I could automatically grab the new Player scripts without going into testing mode and remembered that @/ CloneTrooper1019 had the Roblox Client Tracker and could probably grab the scripts from there.

As far as automatically grabbing the updated scripts goes, at the moment I’m looking at making a plugin that will just grab them from the client tracker, but alternatively you could grab them for use with Rojo if you’re comfortable with messing with git (which I’m honestly not).

Honestly I don’t know why they even bother putting the Camera module in a readily accessible place if they’re just gonna block access to it if you don’t fork the code, but it’s whatever I guess. Live and adapt.

1 Like

In case anyone does care about the situation, I have made a plugin which can grab the latest Player, Camera and Control module scripts from the Roblox Client Tracker as well as generate a local script to use those grabbed modules.

Grabbed modules will be placed into StarterPlayerScripts._Forked and the generated PlayerScriptsLoader will assume that the modules you want to use are located in the _Forked folder.

The plugin is available here:

Alternatively, if you prefer to see the code and perhaps make changes yourself, you can find the source code here:

Images:
image

image

image

1 Like