How do I force the Camera Mode?

In my game, I want to make players unable to change their camera mode since I am using my own custom camera. The problem is, I can’t seem to get this done. As far as I know, the properties for locking the camera mode are StarterPlayer.DevComputerCameraMovementMode and StarterPlayer.DevTouchCameraMovementMode, however, they don’t seem to work. I have tried looking up how to do it, however, I can’t seem to find the solution. I have seen games that lock the camera mode so I know it’s possible. I would appreciate it if anyone can help.

3 Likes

Is this what you meant?
player/localPlayer.CameraMode = Enum.CameraMode.SOME MODE

1 Like

If you are wanting to script your own camera system, in a localscript you could do

local camera = workspace.CurrentCamera
camera.CameraType = Enum.CameraType.Scriptable

This will make the camera not be able to move, and you can change the camera mode to whatever camera mode you would like.
If you are wanting to make it so that players cannot change their cameramode in roblox settings, you can try and change the DevComputerCameraMovementMode in studio, and not with a script.

1 Like

You have to set CameraType to Scriptable – CameraMode is a separate thing that dictates whether you LockFirstPerson or not

1 Like

I apologize for not making my problem clear.

I already have a custom camera that I made and it works fine. The problem is I want to disable the player’s ability to change the camera mode in the settings, but I can’t seem to do that. According to the Dev Hub, the properties StarterPlayer.DevComputerCameraMovementMode and StarterPlayer.DevTouchCameraMovementMode should do this, but that doesn’t seem to be the case. I’ve seen games do this, so I know it is possible. I just can’t seem to figure out how.

StarterPlayer.CameraMode is not what I’m looking for. My camera is set to scriptable so it won’t even do anything. I have also already set both StarterPlayer.DevComputerCameraMovementMode and StarterPlayer.DevTouchCameraMovementMode to “Classic” in Studio to try to disable the player’s ability to change the camera settings, however, this has not worked.

I just tried what you did in Studio and it was working fine. I just changed the StarterPlayer.DevComputerCameraMovementMode to Classic and then set the CameraType to Scriptable using the command bar, and then when I went to settings and tried to change the Camera Mode and it wouldn’t let me – it just said “Set by Developer”

Maybe you’re changing StarterPlayer.DevComputerCameraMovementMode back to UserChoice somehow?

Since my game has the mouse locked to center and my Esc key is a Studio shortcut, I’ve been looking at the game settings by testing it ingame. However I just managed to open the menu in Studio and turns out that in Studio it says Set by Developer for me as well. However, it still doesn’t work ingame.

Oh, and by the way, here are pictures.

In Studio: (This is what I want)

In-game:
Annotation%202019-09-08%20122723

And yes the game is up to date with Studio. I confirmed this by adding a script that printed “Publish” and publishing the game. It printed In-game.

1 Like

Sry I’m on mobile lol

I figured out that if you set DevComputer/TouchCameraMode in the player after a bit of time it will change the setting to Set by developer properly. I didn’t do much testing on it since I’ve decided not to make the setting Set by developer, so I don’t know if it’s server time or client time or even if it works differently than that. I’ve changed my mind about doing this for my game, but for anyone in the future who has this problem, that is your solution.

3 Likes