Unless I’m mistaken, this script was functioning for me up until the recent camera toggle update by Roblox. Does anyone know how I could make it work?
A localscript inside startercharacterscripts:
local Player = game.Players.LocalPlayer
local PlayerCameras = require(Player:WaitForChild(“PlayerScripts”):WaitForChild(“PlayerModule”)):GetCameras()
local UserInputService = game:GetService(“UserInputService”)
local ControllerZoom = 20
local function AddZoom(Amount)
print(“Zoom”,PlayerCameras.activeCameraController)
if PlayerCameras.activeCameraController then
PlayerCameras.activeCameraController:SetCameraToSubjectDistance(PlayerCameras.activeCameraController.currentSubjectDistance + Amount*ControllerZoom)
end
end
UserInputService.InputBegan:Connect(function(InputObject,GPE)
if not GPE then
if InputObject.KeyCode == Enum.KeyCode.Q then
AddZoom(1)
elseif InputObject.KeyCode == Enum.KeyCode.E then
AddZoom(-1)
end
end
end)
This is just a shot in the dark, but try changing PlayerCameras.activeCameraController to PlayerCameras.ActiveCameraController. Roblox has been making a lot of changes to names of values lately.
It seems like a FFlag was activated which causes the Camera module to return an empty table.
You can get around this by forking the module and commenting out the part which can return the blank table.
This does mean that you won’t get updates to the PlayerModule/CameraModule etc, but this will work until the FFlag is turned off.