For an intro on my game, I have the camera rotate around a part and once the player presses the play button the camera should reset and the player gets normal control over their camera. However since today the player can no longer rotate their camera for some reason. I have not changed anything to the code for the past few months, so i do not know what causes this. I have heard something about new playerscripts being the issue though.
The code i use to alter the camera behaviour for the intro is:
workspace:WaitForChild("ShipCenter")
workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
workspace.CurrentCamera.CameraSubject = workspace.ShipCenter
local t = 0
local speed = .01
local angle = 400
local returned = false
tb = game:GetService("RunService").Heartbeat:connect(function()
if not returned then
local position = workspace.ShipCenter.Position + Vector3.new(math.cos(speed*t)*angle, 100, math.sin(speed*t)*angle)
workspace.CurrentCamera.CFrame = CFrame.new(position, workspace.ShipCenter.Position)
t = t+.1
else
tb:Disconnect()
end
end)
And then to reset the camera i do this:
workspace.CurrentCamera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
workspace.CurrentCamera.CameraType = "Custom"
returned = true