Currently, a player’s DevCameraOcclusionMode
(Player | Documentation - Roblox Creator Hub) cannot be set by any localscripts. Attempting to do so throws a security permissions error. This makes it impossible to toggle the camera’s Invisicam
mode at runtime. In a project I am working on, the functionality of Invisicam
is desired in some rounds. One round features a semi-vertical camera view looking down on the player. When a player runs behind wall, the functionality of Invisicam
allows the player to see where they are going. However, in other rounds, the functionality of Invisicam
is not desired.
By allowing Player.DevCameraocclusionMode
to be changed by a regular localscript, Invisicam
can be toggled at runtime by the developer as desired.