Attempt to index field 'activeMouseLockController' (a nil value)

This is the script, it errors at line 4:

local spawn = require(game.ReplicatedStorage.SpecialScript[“Spawn”])
local plr = game.Players.LocalPlayer
local coreCam = require(plr.PlayerScripts.PlayerModule):GetCameras()
coreCam.activeMouseLockController:EnableMouseLock(false)

What’s weird is before the Roblox update, it works just fine. But after this, it always error at line 4 and the error is the title. Any help is appreciated!

I am aware that the ROBLOX update crippled the client-side access to a majority of the local camera scripts, breaking things such as custom camera controllers, custom mouse locks, and especially the mobile mouselock module.

As I haven’t looked into the new code I really can’t give any advice here, but more-of an assurance that this is in-fact on the part of ROBLOX and not faulty coding.

Yeah, i’m pretty sure Terry is right. If you want to go from client to server than I suggest you get an event/bindable which fire when you do whatever you want it to do.

@Maximum_ADHD picked this up I believe. Roblox have decided to not expose the module for some reason, so the module just returns an empty table.

You might be able to manually fix it by removing the if structure that CloneTrooper1019 quotes in this post: Do *NOT* remove the CameraModule API?

Make it so it returns the cameraModuleObject every time.

The discussion on why they did this and why some developers think they shouldn’t have, and/or provided more notice is all present in the linked thread.

2 Likes