Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Attempting to toggle Invisicam on and off not working?

When you go to customize your character, your camera gets moved. So it may sometimes appear through walls so to counter this I was trying to toggle invisicam. But the script I have right now which is only 1 line doesnt error but it also doesnt work?

Heres the code, its a local script by the way.

game:GetService("StarterPlayer").DevCameraOcclusionMode = Enum.DevCameraOcclusionMode.Invisicam

So I dont really understand why its not working does anyone have any ideas?

Thank you for your time :)

2 comments

0

StarterPlayer and StarterPack and StarterGui are services which are triggered on spawn. Therefore meaning that it is triggered once. Have you tried dying in-game to test it?

0

Then how would I toggle it while they are alive? Its a part of Player so I could do it that way but when I do it gives me a permission error

1 answer

You can do this in a local script only btw

local player = game.Players.LocalPlayer
player.DevCameraOcclusionMode = "Invisicam"

^ do it for a specific player

for i,v in pairs(game.Players:GetChildren())do
	v.DevCameraOcclusionMode = "Invisicam"
end

^ for all players, this has to be a server script

2 comments

0

Use enums, Enum.DevCameraOcclusionMode.Invisicam

0

i dont need to

This discussion is preserved as it was. New answers, comments, and votes are closed.