Characters appear transparent during cutscene

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

loop through all of the BaseParts in the character and change their localTransparencyModifier to 0.

1 Like

I would suggest maybe putting the camera in third person right before the cutscene starts. Do it so fast that the player doesn’t notice.

Would you mind writing some code for me?

you can simply change the CameraSubject (inside the workspace’s camera instance) to anything besides the humanoid while the cutscene is playing, and it should fix the issue

obviously you would have to put the CameraSubject back to the humanoid when it’s done playing

workspace.CurrentCamera.CameraSubject = Character.Head
2 Likes

Oh, so I shouldn’t make the subject nil?