Hey, developers!
I’m creating a horror game that has first-person camera locked and contains cutscenes throughout the game.
Because the character is in first person, when a cutscene happens, the player’s character appears invisible. How could I fix this? Here is the code in the local script that handles cutscenes.
local function camCutscene1()
local endCam1 = workspace.Building2.endCam
--Players.LocalPlayer.CameraMode = "Classic"
--Players.LocalPlayer.CameraMinZoomDistance = 8
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CameraSubject = nil
local goal1 = {}
goal1.CFrame = CFrame.new(20, 20, 334, -1, 0, -1.1920929e-07, 0, 1, 0, 1.1920929e-07, 0, -1)
--* CFrame.Angles(0, 90, 0)
local goal2 = {}
goal2.CFrame = CFrame.new(20, 18, 346, -1, 0, -1.1920929e-07, 0, 1, 0, 1.1920929e-07, 0, -1)
--* CFrame.Angles(-90, 0, 0)
local tweenInfo1 = TweenInfo.new(5, Enum.EasingStyle.Sine)
local tweenInfo2 = TweenInfo.new(5, Enum.EasingStyle.Sine)
local tween1 = TweenService:Create(Camera, tweenInfo1, goal1)
local tween2 = TweenService:Create(Camera, tweenInfo2, goal2)
Camera.CFrame = endCam1.CFrame
tween1:Play()
wait(5)
tween2:Play()
wait(5)
Camera.CameraType = Enum.CameraType.Custom
wait(5)
--Players.LocalPlayer.CameraMode = "LockFirstPerson"
--Players.LocalPlayer.CameraMinZoomDistance = 0.5
end