I am making a cryo-freeze chamber which you can view in action here.
When you are frozen, CamFreeze is parented to your Character and run:
local cam = workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Scriptable
local val = script:WaitForChild("Value")
cam.CoordinateFrame = CFrame.new(
val.Value,
script.Parent.Head.Position
)
repeat wait() until script.Parent.Head.Anchored
cam.CoordinateFrame = CFrame.new(
val.Value,
script.Parent.Head.Position
)
script:Destroy()
And, when thawed, CamThaw:
local cam = workspace.CurrentCamera
cam.CameraType = Enum.CameraType.Custom
cam.CameraSubject = script.Parent.Humanoid
script:Destroy()
My problem is that CamThaw isn't fixing the Player's camera more than once each life. CamFreeze appears to work every time, but CamThaw only works the first time in online and Test Servers. (Test Server players are also unable to actually click the SurfaceGui button, but that's probably a ROBLOX bug as it works in Online Servers.)
What can I do to get this to work? I'm much prefer to have the camera manipulation, because otherwise the only way out of the chamber is to have someone else release you or to reset your character.

5 comments
Is the CameraSubject changing? Like, if you do print(cam.CameraSubject) will it print Humanoid?
I dunno this code looks good.
It prints "Humanoid" before and after. I changed the code in CamFreeze to set it to
nil, and it will printnilbefore andHumanoidafter, but it still doesn't work more than once.If it actually IS changing the camera subject, then I don't know. I've run into errors like this before, where you change something but it doesn't behave as if changed. Probably a Roblox error.
Well that's annoying. I may have to resort to calling LoadCharacter on it, which requires a dozen more lines of sanity checking. :/