Switching Cameras Issue (REPOST)

So I’ve been trying to make this game, it is basically a fan FNAF game. So I have a part as the camera instead of the player, and I don’t want the player to be able to move the camera by themselves. I can switch to the cameras fine, but when I switch back to the main room, it turns me and lets me move the camera around.

I’ve been searching for two whole days for a solution on every single thing to ever exist, and no result. I’ve tried different scripts from the website, changing the camera settings, forcing you into first person, but nothing worked. Is there another script that would fix my issue?

Here is a video if that made no sense to you: https://youtu.be/lY-hiQ1NjyU

Here is the script for the exit GUI if it is any help.

local cam = workspace.CurrentCamera
script.Parent.MouseEnter:connect(function()
cam.CameraType = Enum.CameraType.Attach
cam.CameraSubject=workspace.CamPart
game.Workspace.CurrentCamera.CameraSubject = game.Workspace.CameraPart
game.Workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
end)

1 Like

You should use Enum.CameraType.Scriptable instead of Enum.CameraType.Attach

Attach: Camera moves with the subject at a fixed offset and will rotate as the subject rotates.
Custom: Default mode used by Roblox Core Scripts.

(CameraType | Documentation - Roblox Creator Hub)

2 Likes

Hmm. That didn’t work. All it did was not let me switch back to the camera part.