Any reason as to why it is not changing the camera mode? I tried both local, and normal scripts.
player = game.Players.LocalPlayer function onTouched(hit) player.CameraMode = "Custom" end script.Parent.Touched:connect(onTouched)
What you are trying to do is change a player's CameraMode
property to a Camera
object's CameraType
, which you cannot do.
If you just want a player to have a first-person or third-person view, you would do something like this:
player.CameraMode = Enum.CameraMode.LockFirstPerson player.CameraMode = Enum.CameraMode.Classic
However, seeing how you want to change it to "Custom," you would have to do so by changing the local camera's CameraType
like this:
local player = game.Players.LocalPlayer local cam = game.Workspace.CurrentCamera -- The local camera you want cam.CameraType = "Custom"
Hope this helps! If it does, don't forget to click "Accept Answer" and/or +1 my Rep!