I’m having trouble trying to access the camera module
What do you want to achieve? Keep it simple and clear!
I want to get the camera module
What is the issue? Include screenshots / videos if possible!
Cameras in PlayerModule is {}
local PlayerModule = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule"))
local Cameras = PlayerModule:GetCameras()
print(Cameras)
print(PlayerModule)
What solutions have you tried so far?
I tried to import the same module from another game.
Did you look for solutions on the Developer Hub?
Yes, but I didn’t found nothing.
Ok after some searching in CameraModule and Roblox Devforum I found where is the problem, recently Roblox add some kind of filter to the CameraModule called Camera API or something like that, if you look at the end of the CameraModule script you will find
local cameraModuleObject = CameraModule.new()
local cameraApi = {}
if FFlagUserRemoveTheCameraApi then
return cameraApi
else
return cameraModuleObject
end
The reason of this to stop users from changing the module externaly, so if FFlagUserRemoveTheCameraApi is true the CameraModule will return an empty table which is the cameraApi.
The FFlagUserRemoveTheCameraApi is defined by UserSettings():IsFeatureEnabled("UserRemoveTheCameraApi")
So to fix all of this you should change the end of the camera module to this:
return cameraModuleObject
and copy the hole PlayerModule in your StarterPlayerScripts, I already edit the module, so if you dont know how to do that just download this and paste it in your StarterPlayerScripts. PlayerModule.rbxm (122.0 KB)