Hey guys,
So I am making a starting screen of the game, it works well until sometimes this random error occurs.
What I do is to set the camera type to Enum.CameraType.Scriptable and then setting the CFrame of the camera.
It works flawlessly most of the time but randomly bugs which is just so annoying.
How can I fix it?
LocalScript in starterpack:
--anirudh851
local plr = game.Players.LocalPlayer
local char = plr.Character
local camera = workspace.CurrentCamera
repeat wait()
camera.CameraType = Enum.CameraType.Scriptable
until camera.CameraType == Enum.CameraType.Scriptable
if workspace:FindFirstChild("StartingCameraPos") then
repeat wait()
camera.CFrame = workspace.StartingCameraPos.CFrame
until camera.CFrame == workspace.StartingCameraPos.CFrame
else
repeat wait()
workspace.CurrentCamera.CameraType = Enum.CameraType.Custom
until workspace.CurrentCamera.CameraType == Enum.CameraType.Custom
camera.CFrame = camera.CFrame
camera.CameraSubject = game.Players.LocalPlayer.Character.Humanoid
end
Thanks!