Hello again,
So I’m experiencing something weird. For quick context, I recently made a topic explaining how I have a game used for testing purposes before placing things into the main game. Also how whenever I placed certain things into the main game, things began to bug. Alright anyways, this time I’m having issues with a death cutscene that plays whenever my AI kills you. For some reason, a black screen is showing while the cutscene plays, which I’m lost on why that is. I’ve tried looking for threads that could possibly help out but found nothing, tried looking at YouTube and found nothing either.
What it’s supposed to look like when you get killed (working in testing game):
Behind the scenes:
Just a model in Workspace of a box with the AI duplicate inside.
Jump scare handler in StarterGui (plays the cutscene when dead)
The code inside the local script
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait()
local char = player.Character or player.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local camera = workspace:WaitForChild("JumpscareBox"):WaitForChild("JSR1")wait()
local TweenService = game:GetService("TweenService")
local Camera = game.Workspace.CurrentCamera
humanoid.Died:Connect(function()
local function MoveCamera(StartPart, EndPart, Duration, EasingStyle, EasingDirection)
Camera.CameraType = Enum.CameraType.Scriptable
Camera.CFrame = StartPart.CFrame
local Cutscene = TweenService:Create(Camera, TweenInfo.new(Duration, EasingStyle, EasingDirection), {CFrame = EndPart.CFrame})
Cutscene:Play()
wait(Duration)
end
local function Cutscene()
script.Parent.ScareNoise.Playing = true
MoveCamera(game.Workspace.JumpscareBox.JSR1, game.Workspace.JumpscareBox.JSR2, .065, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR2, game.Workspace.JumpscareBox.JSR3, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR3, game.Workspace.JumpscareBox.JSR2, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR2, game.Workspace.JumpscareBox.JSR3, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR3, game.Workspace.JumpscareBox.JSR2, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR2, game.Workspace.JumpscareBox.JSR3, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR3, game.Workspace.JumpscareBox.JSR2, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR2, game.Workspace.JumpscareBox.JSR3, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR3, game.Workspace.JumpscareBox.JSR2, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR2, game.Workspace.JumpscareBox.JSR3, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
MoveCamera(game.Workspace.JumpscareBox.JSR2, game.Workspace.JumpscareBox.JSR3, .05, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
script.Parent.ScareCrack.Playing = true
MoveCamera(game.Workspace.JumpscareBox.JSR3, game.Workspace.JumpscareBox.JSR4, .02, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
wait(1)
MoveCamera(game.Workspace.JumpscareBox.JSR4, game.Workspace.JumpscareBox.JSR5, 0.3, Enum.EasingStyle.Linear, Enum.EasingDirection.Out)
wait(0.05)
game.Workspace.bodycollapse:Play()
wait(0.3)
end
Cutscene()
Camera.CameraType = Enum.CameraType.Custom
end)
Works good with the clip from earlier as proof.
Video of how things look once in the main game:
How things are set up:
Literally the exact same lol.
Initially, I had the thought that maybe the cameras were unanchored and had fallen down on the black surface of the box. Nope, they were anchored just as needed. I have a few other cutscenes in the game and I tested those to see if maybe they gave a black screen all of a sudden too. Nope, they were working perfectly fine except this particular one I’m struggling with. I then thought that maybe the AI got unanchored from its spot and fell.
Nope, the AI was placed on top of a anchored invisible part just as is in the testing game where it worked. I then decided to move the cameras to the side outside the black box to see if I seen anything and to my surprise, it is indeed a black screen. I wasn’t getting any errors in the output either relevant to this. I did see some error from a player AntiCollision script I have but am not sure if it has anything to do with this though some of the cameras are inside of each other:
Script it’s referring to
The code inside of it
local Players = game:GetService("Players")
local PhysicsService = game:GetService("PhysicsService")
local GroupName = "Players"
PhysicsService:CreateCollisionGroup(GroupName)
PhysicsService:CollisionGroupSetCollidable(GroupName, GroupName, false)
Players.PlayerAdded:connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local function ChangeGroup(Part)
if Part:IsA("BasePart") then
PhysicsService:SetPartCollisionGroup(Part, "Players")
end
end
Character.ChildAdded:Connect(ChangeGroup)
for _, Object in pairs(Character:GetChildren()) do
ChangeGroup(Object)
end
end)
end)
I’d appreciate any help!! I just don’t know how it works in one game but not the other…