I want to change the current camera around in a script, but when i set the camera back to the original one, it snaps back to world origin after 1 frame.
game.Players.LocalPlayer.Character:WaitForChild("Humanoid")
print("a")
UserInputService = game:GetService("UserInputService")
MainCam = workspace.CurrentCamera
SpecPart = workspace.wee
local function UnSpec(Input,idk)workspace.CurrentCamera = MainCam
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
workspace.CurrentCamera.CameraType = "Custom"
task.wait(0)
end
MainCam = workspace.CurrentCamera
UserInputService.InputBegan:Connect(function(input)
print(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
workspace.CurrentCamera = SpecPart.Camera
elseif input.UserInputType == Enum.UserInputType.MouseButton2 then
UnSpec()
end
end)
Instance.new("Camera").Parent = SpecPart
SpecPart.Camera.CameraType = "Custom"
SpecPart.Camera.CameraSubject = SpecPart
I have looked at camera documentaion and other stuff, and no one ive seen has encountered this issue with this kind of manipulation to the camera