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

How to reset a Player's Camera after setting the CFrame?

Hey, I was recently messing around with some basic scripts for setting the Camera's CFrame (mainly for main menu type things), and while setting it does work, I have not been able to successfully reset the Player's Camera back to their character. I've tried multiple different things, such as changing the properties, destroying CurrentCamera, and a few other things, which do not seem to work. Any suggestions as to how I could reset it?

All of the scripts below are in a LocalScript.

Code (for setting the CFrame):

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
game.Workspace.CurrentCamera.CFrame = CFrame.new(-276.006775, 14.0770245, 81.1118164, -0.934831619, -0.00371354632, 0.355072141, -0, 0.999945462, 0.0104579963, -0.355091572, 0.00977646559, -0.934780478)

Code (for attempting to set the camera back)

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Fixed
game.Workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid

Code (destroying the camera)

game.Workspace.CurrentCamera:Destroy()

Thanks. :)

1 answer

✓ Accepted answer

Set the CameraType to Custom.

game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom

1 comment

0

Thanks. :)

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