Custom center-locked camera not working

Hello, I’m having some issue with this script, it tells me that CamerController is a nil value, same for MouseLockController, in lines : CameraController:SetIsMouseLocked(false) and if MouseLockController:GetIsMouseLocked() then -- toggle shift lock off. Thank you in advance for the help.

1 Like

how have you defined CameraController and MouseLockController?

1 Like

Can we see your code? Are you exactly copy and pasting it? This is an old post, I believe they may have changed the module since then, so this script may no longer work.

1 Like

So, I modified only the way the functions gets called, let me send the code… https://gyazo.com/543819e41efea73a02154d07ffa44cba https://gyazo.com/6b62b02437af609c04f1899a649685b6

I tried declare them locally and globally, in both case they didn’t work.

The camera module was changed to specifically break everything that uses it. There’s a discussion here Third Person Mouse Move Camera Help - #10 by fireboltofdeath
If you want it to work again then you’ll need to replace the camera module.

3 Likes

So I can’t basically use the actual new camera module right? Also, changing it back to old version will let the game have any disadvatages?

Until it’s enabled again, it can’t be used, it has to be replaced with a modified version. This happened seemingly without warning so it might be better to keep a version you know isn’t going to change again.

1 Like

So, for replacing I have to put the module in playerscripts, but then? The default module will be there, and I can’t access playerscripts from server-side to delete it.

The solution on that discussion was updated to have the solution to re-enabling the Camera API. It isn’t too in-depth, but you pretty much just download a model file and drop it into StarterPlayerScripts.

1 Like

Yes, I did it before and it worked fine, thank you.